Help - Search - Members - Calendar
Full Version: how to use get_playing_item_location?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
sun4384
I tried to use get_playing_item_location, but it just returns -1 for playlist index and item index. Is there a specific condition for this call to succeed? get_playing_playlist and playlist_find_item seem to work though.
foosion
Do you call it from the main thread? Do you call it from inside callback? Does double clicking on the status bar focus the playing track when that call fails for you?
sun4384
QUOTE (foosion @ Dec 8 2008, 15:37) *
Do you call it from the main thread? Do you call it from inside callback? Does double clicking on the status bar focus the playing track when that call fails for you?


Inside the on_playback_new_track callback. Isn't it called from the main thread?
foosion
I tried it out myself and checked back with Peter. Apparently the on_playback_new_track callback is triggered before playlist gets notified about the new track, so it will still return the old one (if available). By the way, you should check the return value of get_playing_item_location. A suitable workaround would be to defer the processing of that callback by registering a main_thread_callback from within on_playback_new_track.
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-2009 Invision Power Services, Inc.