Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Toogle button (Read 1439 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Toogle button

Reply #1
You can monitor the "stop after current" status like this:

Code: [Select]
#include "foobar2000/SDK/config_object_impl.h"

auto f_on_changed = [](const service_ptr_t<config_object>& conf_obj) {
  auto status = conf_obj->get_data_bool_simple(false);

  FB2K_console_formatter() << "stop after current is " << (status ? "set" : "not set");
};

static config_object_notify_simple_factory g_stop_after_current_monitor(standard_config_objects::bool_playlist_stop_after_current, f_on_changed);

This will write the current status of "stop after current" to the console. Depending on your project settings you might need to adjust the path for the include.


Re: Toogle button

Reply #3
The toolbar button monitors the status of stop after current already. I want to monitor status of Stop after album in button toolbar. I think it's impossible for DUI.
The monitoring for "stop after album" can be done by replacing standard_config_objects::bool_playlist_stop_after_current with guid_cfg_menu_stopalbum_enabled in the code above, but I don't see any possibility to visualize it in the button toolbar.

 

Re: Toogle button

Reply #5
Looks possible with the Columns UI SDK...

Code: [Select]
/**
 * \brief Identifies the state of a button.
 *
 * Combine multiple flags using bitwise or.
 *
 * \see button::get_button_state
 */
enum t_button_state {
    /** The button is enabled */
    BUTTON_STATE_ENABLED = (1 << 0),
    /** The button is in an active state */
    BUTTON_STATE_PRESSED = (1 << 1),
    /** The button displays a ToolTip */
    BUTTON_STATE_SHOW_TOOLTIP = (1 << 2),
    /** The default button state */
    BUTTON_STATE_DEFAULT = BUTTON_STATE_ENABLED | BUTTON_STATE_SHOW_TOOLTIP,
};