Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/gtkui/callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,10 @@ void
on_resume_last_session_toggled (GtkToggleButton *togglebutton,
gpointer user_data);

void
on_resume_always_paused_toggled (GtkToggleButton *togglebutton,
gpointer user_data);

void
on_jump_to_current_track1_activate (GtkMenuItem *menuitem,
gpointer user_data);
Expand Down
20 changes: 20 additions & 0 deletions plugins/gtkui/deadbeef.glade
Original file line number Diff line number Diff line change
Expand Up @@ -3408,6 +3408,26 @@ Only prevent clipping</property>
</packing>
</child>

<child>
<widget class="GtkCheckButton" id="resume_always_paused">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Always resume session in paused state</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_resume_always_paused_toggled" last_modification_time="Fri, 03 Oct 2025 12:51:07 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>

<child>
<widget class="GtkCheckButton" id="ignore_archives">
<property name="visible">True</property>
Expand Down
9 changes: 9 additions & 0 deletions plugins/gtkui/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,7 @@ create_prefwin (void)
GtkWidget *cli_add_to_playlist;
GtkWidget *cli_playlist_name;
GtkWidget *resume_last_session;
GtkWidget *resume_always_paused;
GtkWidget *ignore_archives;
GtkWidget *reset_autostop;
GtkWidget *reset_autostopalbum;
Expand Down Expand Up @@ -2135,6 +2136,10 @@ create_prefwin (void)
gtk_widget_show (resume_last_session);
gtk_box_pack_start (GTK_BOX (vbox8), resume_last_session, FALSE, FALSE, 0);

resume_always_paused = gtk_check_button_new_with_mnemonic (_("Always resume session in paused state"));
gtk_widget_show (resume_always_paused);
gtk_box_pack_start (GTK_BOX (vbox8), resume_always_paused, FALSE, FALSE, 0);

ignore_archives = gtk_check_button_new_with_mnemonic (_("Don't add from archives when adding folders"));
gtk_widget_show (ignore_archives);
gtk_box_pack_start (GTK_BOX (vbox8), ignore_archives, FALSE, FALSE, 0);
Expand Down Expand Up @@ -3317,6 +3322,9 @@ create_prefwin (void)
g_signal_connect ((gpointer) resume_last_session, "toggled",
G_CALLBACK (on_resume_last_session_toggled),
NULL);
g_signal_connect ((gpointer) resume_always_paused, "toggled",
G_CALLBACK (on_resume_always_paused_toggled),
NULL);
g_signal_connect ((gpointer) ignore_archives, "toggled",
G_CALLBACK (on_ignore_archives_toggled),
NULL);
Expand Down Expand Up @@ -3630,6 +3638,7 @@ create_prefwin (void)
GLADE_HOOKUP_OBJECT (prefwin, cli_add_to_playlist, "cli_add_to_playlist");
GLADE_HOOKUP_OBJECT (prefwin, cli_playlist_name, "cli_playlist_name");
GLADE_HOOKUP_OBJECT (prefwin, resume_last_session, "resume_last_session");
GLADE_HOOKUP_OBJECT (prefwin, resume_always_paused, "resume_always_paused");
GLADE_HOOKUP_OBJECT (prefwin, ignore_archives, "ignore_archives");
GLADE_HOOKUP_OBJECT (prefwin, reset_autostop, "reset_autostop");
GLADE_HOOKUP_OBJECT (prefwin, reset_autostopalbum, "reset_autostopalbum");
Expand Down
11 changes: 11 additions & 0 deletions plugins/gtkui/prefwin/prefwinplayback.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ prefwin_init_playback_tab (GtkWidget *_prefwin) {
// resume last session
prefwin_set_toggle_button("resume_last_session", deadbeef->conf_get_int ("resume_last_session", 1));

// resume always paused
prefwin_set_toggle_button("resume_always_paused", deadbeef->conf_get_int ("resume_always_paused", 0));

// add from archives
prefwin_set_toggle_button("ignore_archives", deadbeef->conf_get_int ("ignore_archives", 1));

Expand Down Expand Up @@ -149,6 +152,14 @@ on_resume_last_session_toggled (GtkToggleButton *togglebutton,
deadbeef->conf_set_int ("resume_last_session", active);
}

void
on_resume_always_paused_toggled (GtkToggleButton *togglebutton,
gpointer user_data)
{
int active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
deadbeef->conf_set_int ("resume_always_paused", active);
}

void
on_gui_plugin_changed (GtkComboBox *combobox,
gpointer user_data)
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ save_resume_state (void) {
int playtrack = -1;
int playlist = -1;
playlist_t *plt = pl_get_playlist (trk);
int paused = (output->state () == DDB_PLAYBACK_STATE_PAUSED);
int paused = (output->state () == DDB_PLAYBACK_STATE_PAUSED) || (conf_get_int ("resume_always_paused", 0));
if (trk && plt) {
playlist = plt_get_idx_of (plt);
playtrack = plt_get_item_idx (plt, trk, PL_MAIN);
Expand Down
Loading