Skip to main content
Topic: playlist_callback_static implementation (Read 2727 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

playlist_callback_static implementation

  • I have Columns UI extension. It can have multiple instances (windows).
  • I have playlist_callback_static implementation. Its callback methods call static methods of my extension (which redraw all my windows etc.)
  • I'm using this code to 'register' my callback class:
    Code: [Select]
    static service_factory_single_transparent_t< my_playlist_callback > foo1;

Now, the question. I want to use my static callback class ONLY when there are one ore more instances of my UI extension (=multiple displayed windows/panels).

What I'm using now is declare global variable instance_tracker_server_t< my_extension > g_instances. Then inside each callback method (on_playlist_activate, on_playlist_created, on_playlists_reorder, etc.) I check if g_instances.get_count() > 0.

Is there 'nicer' method to do this?


playlist_callback_static implementation

Reply #1
Yes, use a regular play_callback for each of your instances.

SimplePortal 1.0.0 RC1 © 2008-2020