Help - Search - Members - Calendar
Full Version: Play Counter
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
koach
I think I found a minor bug.

Preset name including ']' character isn't saved properly after restart.

Anyway, thanks for the nice component which is really useful.

EDIT:Oops, this is the commet for the extended playlist generator plugin. Sorry, just ignore this.
tboehrer
QUOTE
I mean the current local variables in the callback class. Since the callback is a static class, you can safely move the _played and _length variables out, rename to g_played/g_length, implement the cfg variable storage directly from on_quit.


I gotcha... Mainly I don't do that because global data breaks encapsulation rules of OO... one of the purposes of a class. My preference would be to have no cfg vars be global since they are "owned" by playcounter. Though, breaking encapsulation for a relatively simple piece of code like this was acceptable it seems.

QUOTE
Forcing reload of play count / timestamp for all files referenced in the external database (if you change the formatted tag options, they will be regenerated)


Is there a metadb callback in order for you to know when meta data changes for a track? If so, I would think it would be easy to reload the info fields from the external store automatically.

QUOTE
Forcing scan of external database for entries no longer referenced in the player metadb
- Hilighting entries in the current playlist based on a query to the external database ... could be simplified to facilitate a simpler internal count database, or allow full MySQL query.


Why all this work? Is there some reason you don't want to store this info in the DB? If I had a wish, it would be to have true "DB only" info, maybe with the option for it to be "sticky".... i.e., reloading from file doesn't blow away the sticky info. But I don't have control over that. wink.gif
kode54
QUOTE(tboehrer @ Apr 29 2004, 08:07 PM)
QUOTE
I mean the current local variables in the callback class. Since the callback is a static class, you can safely move the _played and _length variables out, rename to g_played/g_length, implement the cfg variable storage directly from on_quit.


I gotcha... Mainly I don't do that because global data breaks encapsulation rules of OO... one of the purposes of a class. My preference would be to have no cfg vars be global since they are "owned" by playcounter. Though, breaking encapsulation for a relatively simple piece of code like this was acceptable it seems.

Now if only more people thought this way when writing audio player code, and perhaps emulators that could be modified to play only audio. There's a new N64 format, but it's a huge mess of single instance crap that I'll have to get bored and wrap into classes some day.

QUOTE
QUOTE
Forcing reload of play count / timestamp for all files referenced in the external database (if you change the formatted tag options, they will be regenerated)


Is there a metadb callback in order for you to know when meta data changes for a track? If so, I would think it would be easy to reload the info fields from the external store automatically.

Well, you see, I do get a callback notice after the info is reloaded into the database, but I can't modify the metadata within the callback. I have to queue a db-only update for that information to occur after the callback, using a message window. This delay tactic prevents the new info from appearing in places such as the file info dialog. Once again, it's another hack for doing something the API was not designed for. (Yet.)

QUOTE
QUOTE
Forcing scan of external database for entries no longer referenced in the player metadb
- Hilighting entries in the current playlist based on a query to the external database ... could be simplified to facilitate a simpler internal count database, or allow full MySQL query.


Why all this work? Is there some reason you don't want to store this info in the DB? If I had a wish, it would be to have true "DB only" info, maybe with the option for it to be "sticky".... i.e., reloading from file doesn't blow away the sticky info. But I don't have control over that. wink.gif

Can you feed SQL queries to the internal database? :B

Like I said, simple queries would be possible with normal info, but until it's possible to register permanent info variables to a particular service, it will be necessary to either write the values to the files' tags, or maintain them in an external storage system. A simple array would do nicely. You can even use the metadb_handles as indexes, for the duration of the process session. The handles would be translated to path/subsong when saving, then to playable_location to metadb_handle on load. (Of course, you'd be wise to do this translation in on_init, once all the components have been loaded and their services registered, etc.)

Whee, fun.
Zulithe
So, adding *.* to "DB Only Mask" will make it only track in the database, and it WON'T write tags to files?

I like this plugin but I don't like components to write tags to my music, I would prefer it in the database always unless I specificy otherwise.

I think this plugin should log this information should be logged by all file types to the DB by default. It's kinda nasty to have it write to the files themselves unless it is a standard tagging format that most other players would recognize (which this isn't, or am i wrong)
tboehrer
QUOTE
So, adding *.* to "DB Only Mask" will make it only track in the database, and it WON'T write tags to files?

I like this plugin but I don't like components to write tags to my music, I would prefer it in the database always unless I specificy otherwise.


All that will do is defer the write to the file until you specifically tell it to update the file with DB info, or when you do some other tag update operation. There is currently no way to never write the tags to the file and have the info in the DB.
Raymond
Now I'm still using Playcount v1.2.
I disable DB and block tag update operations in the same time. So the tags are neither stored in files nor DB. But it really does the counting. I have no idea where the tags are but I like this way.
The later versions lost this "feature".
tboehrer
QUOTE
I disable DB and block tag update operations in the same time. So the tags are neither stored in files nor DB. But it really does the counting. I have no idea where the tags are...


Neither do I.... blink.gif
Silverbolt
QUOTE(Raymond @ May 15 2004, 04:09 PM)
I have no idea where the tags are...

Maybe they're being stored in the playlists. Check the .fpl files in "C:\Program Files\foobar2000\playlists\"
Raymond
QUOTE(Silverbolt @ May 15 2004, 06:17 PM)
Maybe they're being stored in the playlists. Check the .fpl files in "C:\Program Files\foobar2000\playlists\"

You're right! Tags are being stored there.
So, tboehrer, is it possible to add an option to store tags ONLY in .fpl files?
tboehrer
QUOTE
is it possible to add an option to store tags ONLY in .fpl files?


No clue. It's not something I control. That I know of at least. sad.gif
tboehrer
You can also check with kode54... he posted some messages saying he was working on a version that writes the tags to an external DB. I don't know the status of it though.
Raymond
QUOTE(tboehrer @ May 15 2004, 06:37 PM)
No clue.  It's not something I control.  That I know of at least.  sad.gif

I know nothing about foobar plugin programming. But actually v1.2 was already in this way...
tboehrer
QUOTE
I know nothing about foobar plugin programming. But actually v1.2 was already in this way...


The last version added an option to disable the "skip if not in DB" feature. It's more likely that when you disabled the DB, the plugin simply ignores the track. I truly don't have much control over what gets written where... I simply make a call to some SDK code and it does the rest.
Zulithe
Thanks for the reply tboehrer. I will wait for kode54's new version (if it becomes available). Very nice plugin ... once it can write to a DB and not to the files themselves I will be pleased happy.gif This is functionaliy from Winamp 5 which I miss in foobar2000
tboehrer
Minor release:

Version 1.5 (May 17 2004)

1) Added julian date format
2) Fixed bug with "Skip tracks not in the DB" not being checked first.


The Julian date is used by specifying either %j or %J in the format. Use %j to use a julian date without the time fraction, or %J to get the full Julian date.
leows
I searched in the forum, but don't found nothing, then here goes my question:
How can I change:
DDMMYY to YYYY.MM.DD (or YY.MM.DD)
and HHMMSS to HH:MM
? huh.gif

I want to show this way in playlist: YYYY.MM.DD - HH:MM
Paranoia
this should do what you want - tell me if it doesn't work as I haven't tested it:
CODE

$ifgreater($substr(%play_date%,5,6),20,19$substr(%play_date%,5,6),20$substr(%play_date,5,6)).
$substr(%play_date%,3,4).$substr(%play_date%,1,2) -
$substr(%play_time%,1,2):$substr(%play_time%,3,4)


Steve
Zurman
Or if you want a much simplier way, try to put

"%Y.%M.%D" in the play_date tag (in configuration of play_count)

and "$H:$M" in the play_time tags

and then %play_date% - %play_time% in your playlist biggrin.gif
Paranoia
^ But that would require reformatting old tags wouldn't it tongue.gif

Steve
tboehrer
Paranoia Posted on Jun 20 2004, 11:35 AM
QUOTE
^ But that would require reformatting old tags wouldn't it

Steve 


Yes. The masstagger works well for reformatting. I would reformat prior to changing the Play Counter format though.
Zurman
QUOTE(Paranoia @ Jun 20 2004, 08:35 AM)
^ But that would require reformatting old tags wouldn't it tongue.gif

Steve

true, I hadn't thought to that dry.gif

My solution is better on the long run, yours is better on the short term tongue.gif

As tboehrer says, the best is probably to masstag and then change the play_date & time tags configuration
leows
Thanks everybody.

I will change that format of the variables, then use the Paranoia's strings to format it in the playlist.
Andu use masstagger to change the old ones.

Paranoia, your string is buggy, it shows 20TA.06.20 20:12 per example, but that ok, i'll use %Y to get YYYY.
Go2Null
@tboehrer:
I had a look at your website but didn't see the 1.5 version. Is that the foo_playcount.dll file?
Also, this looks like a great plug-in, could you have it added to the plug-ins page?
Thanks for the great work.
anza
By the way, could you implement an option to update counter when playback percentage is n% OR nminutes? It would be really great for some songs that have hidden tracks (ie looong part of silence in the middle, which one usually just skips).
spase
QUOTE(tboehrer @ May 15 2004, 03:51 PM)
QUOTE
So, adding *.* to "DB Only Mask" will make it only track in the database, and it WON'T write tags to files?

I like this plugin but I don't like components to write tags to my music, I would prefer it in the database always unless I specificy otherwise.


All that will do is defer the write to the file until you specifically tell it to update the file with DB info, or when you do some other tag update operation. There is currently no way to never write the tags to the file and have the info in the DB.

Just get all the normal tags the way you like it, then write protect all of your files.

Thats what I am doing.

DB will be updated, but files will not.
studentism
Uh, I don't know if this is a problem for anyone else, it could be just me, but if foobar isn't the window in focus, the playcount doesn't update itself. It isn't a major issue, just a minor inconvenience. Thanks.
spase
QUOTE(studentism @ Jun 25 2004, 08:09 PM)
Uh, I don't know if this is a problem for anyone else, it could be just me, but if foobar isn't the window in focus, the playcount doesn't update itself.  It isn't a major issue, just a minor inconvenience.  Thanks.

I don't get this problem here.

Make sure the file is in the database if you have it set to ignore files not in the database.
tboehrer
QUOTE (studentism @ Jun 25 2004, 08:09 PM)
QUOTE
Uh, I don't know if this is a problem for anyone else, it could be just me, but if foobar isn't the window in focus, the playcount doesn't update itself. It isn't a major issue, just a minor inconvenience. Thanks.


I don't see that here either. In fact, 90% of the time, fb2k is minimized to the systray for me.

Of course... that doesn't mean something weird isn't happening... just that without being able to reproduce it, chances are next to nothing I'd be able to fix it.
studentism
Hm, fooling around with it a little more, I've discovered that it's doing it selectively, which leads me to believe it's related to something else other than just the window being out of focus (although when it is in focus, it updates every time). I guess I'll fiddle around with it a little more and see if I can figure it out. Thanks.
BO(V)BZ
tboehrer:

I've got a small feature request. Could you add some shortcuts to increment/decrement [I only need increment, but for sake of completeness, decrement would be good] the playcounter? I'd like to be able to assign a hotkey to do this so I can change my play counter easily.

The reason I'm interested is that I put some of my music on my work computer, but I'd like to easily update the PC's on my home computer. I doubt that this would take too much work, and I'd certainly appreciate it =]

Thanks!
Silverbolt
QUOTE(BO(V)BZ @ Jun 27 2004, 10:01 AM)
I've got a small feature request.  Could you add some shortcuts to increment/decrement... I'd like to be able to assign a hotkey to do this so I can change my play counter easily.

You can do this by using musicmusic's Quick Tag.

Make a new item, enter "PLAY_COUNTER" as the Field Name, "$add(%play_counter%,1)" as the Value, and be sure to check "Use value string to titleformat track for actual value". It'll then become available in the context menu where you can also assign your keyboard shortcut. Cheers.
BO(V)BZ
Silverbolt,

Thanks for the advice, I wasn't aware of that plugin =] Works just fine, no need to add that feature now, unless you really want to tongue.gif
Zoominee
@Neksus
Thanks formirroring the foo_playcount file! The "official" download link has been quite hopeless during the last two hours...
Morgensonne
Does anybody use Playcounter for it's cue files? I have a problem to get my cue files updated with the REM Play_counter tags! My questions in "foo_cue_ex" plugin thread can't be solved or reproduced.

thanks & ciao
Mike Giacomelli
Wow it "just works" without me doing anything or making any attempt to learn abou tit. Thanks for the great plugin smile.gif
tedor
one feature request: could you make an option for songs with a lower playcount have a higher chance of being played under random order?
it would imo make this plugin complete. other than that, awesome plugin. just what i was looking for.
Morgensonne
QUOTE(tedor @ Jul 11 2004, 06:50 AM)
one feature request: could you make an option for songs with a lower playcount have a higher chance of being played under random order?
*



I think this can not be done through the playcounter plugin, cause the random play order is arranged by the core (if "arrange" is the right word, when talking about "randomize").

If you wanna hear songs with a less playcount, why not "Generate" a playlist and reverse sort by playcount?
tedor
id prefer it be automated.
not worth it otherwise imo. :\
Go2Null
QUOTE(tedor @ Jul 11 2004, 01:08 PM)
id prefer it be automated.
not worth it otherwise imo. :\
*



Which leads to, in my opinion, the most required (read: lacking) feature in fb2k - that is, auto-playlists. You define a query and whenever you launch fb2k, or click "refesh", it updates the playlist. w00t.gif
tboehrer
QUOTE
Which leads to, in my opinion, the most required (read: lacking) feature in fb2k - that is, auto-playlists. You define a query and whenever you launch fb2k, or click "refesh", it updates the playlist.


Wrong thread for this reply, but...

The next version of the Extended Playlist Generator will probably have the "refresh on reload" option. While it's not as easy as "clicking refresh", the Ext. Playlist Generator has presets which allow you to quickly regen a playlist already.
Zoominee
Hi. Is there something wrong with the binary download link on p1 of this thread? It downloads well, but on execution the file says "This is not a valid Win32 application".

[EDIT] Yes, got it. For some reason, Opera suggests saving the file as .exe, but it's actually a .dll file. If I rename it to .dll, it works.
eweaverp
I've been having problems with this plugin writing tag information to .ogg files? It only works the first time, after that it spits out some errors and can't start any further music streams, so I have to restart foobar. Very odd.

Any clues?
jesusxl
Just to be sure: this plugin extends ID3 tags with three new fields?
If so, is it possible to easily remove these tags again after you've used them?

Another question: if I put all my files in one playlist, how do I sort them by playcount?
So the most played file will appear at the top of the list, and the less played file at the bottom.

Thanks for your great plugin!
jkwarras
QUOTE(jesusxl @ Nov 21 2004, 10:41 AM)
Another question: if I put all my files in one playlist, how do I sort them by playcount?
*

If you're using Column UI, make a column for rating and click on the header of this column.

Anyway to sort if by playcount you can do it with this with 'Custom sort' under preferences:
CODE
$num(%play_counter%,4)


Or another easy way with Extended PLaylist Generator:
Query: play_counter GREATER 0
Search What: Database
Sort spec: $num(%play_counter%,4) (click on 'reverse')
foosion
QUOTE(jesusxl @ Nov 21 2004, 07:41 PM)
Another question: if I put all my files in one playlist, how do I sort them by playcount?
So the most played file will appear at the top of the list, and the less played file at the bottom.
*
From the main menu, choose "Playlist/Sort/Sort by...", enter "$num($sub(9999,%play_count%),4)", click OK. Works without any additional components (apart from foo_playcount of course).
kode54
Or, %__play_count% if you use my version.
TedFromAccounting
Can anyone tell me how I could convert a play_date of DDMMYY and a play_time of HHMMSS to MM/DD/YY and HH:MM:SS

So for example, right now my play_date field looks like 230904, and i'd like it to be 09/23/04. My play_time field looks like 171852, and i'd like that to be 17:18:52.

I've looked at the string in a previous post, but im not sure if there's a way i can change it, or if it will even work at all for me.

CODE
$ifgreater($substr(%play_date%,5,6),20,19$substr(%play_date%,5,6),20$substr(%play_date,5,6)).
$substr(%play_date%,3,4).$substr(%play_date%,1,2) -
$substr(%play_time%,1,2):$substr(%play_time%,3,4)


Any help would be appreciated.
Silverbolt
QUOTE(TedFromAccounting @ Nov 23 2004, 07:17 PM)
Can anyone tell me how I could convert a play_date of DDMMYY and a play_time of HHMMSS to MM/DD/YY and HH:MM:SS
*

CODE
[$substr(%play_date%,3,4)/$left(%play_date%,2)/$right(%play_date%,2)]
[ - $left(%play_time%,2):$substr(%play_time%,3,4):$right(%play_time%,2)]
TedFromAccounting
Thanks! Works perfect smile.gif
MC Escher
Hi,

I've been toying with the playcount for the database explorer panel, and somehow I've been able to make it sort for the number of times played, but I would also like to be able to select the top 50 most played songs or the top 50 most played artists (or something like that). Is it possible to add that through some format string?

Currently I have the following line in the preferences:
CODE
By Playcount|$if(%play_counter%,%play_counter%)


Now the panel looks like:
CODE
[-] - All Music
__[+] - By album
__[+] - ...
__[-] - By playcount
_______1
_______2
_______etc...


I'ld like it to become something like:
CODE
[-] - All Music
__[+] - By album
__[+] - ...
__[-] - By playcount
_______Top 50 songs
_______Top 50 artists
_______1
_______2
_______etc...


I'm not sure wether this is the right place to ask it, since it's also a lot about the database explorer panel, but off course also the paycount plug-in.
But all help is appreciated, I'ld love to see this work.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.