diff --git a/osx/deadbeef.xcodeproj/project.pbxproj b/osx/deadbeef.xcodeproj/project.pbxproj index 87ef9e2086..164b560f17 100644 --- a/osx/deadbeef.xcodeproj/project.pbxproj +++ b/osx/deadbeef.xcodeproj/project.pbxproj @@ -720,7 +720,6 @@ 2D11D3CD1B9DC6B500C7C731 /* vtx.dylib in Copy Plugins */ = {isa = PBXBuildFile; fileRef = 2D11D3B91B9DC67100C7C731 /* vtx.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 2D11E8B21AA0E3DD00A67A20 /* MainWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D11E8AF1AA0E3DD00A67A20 /* MainWindowController.h */; }; 2D11E8B31AA0E3DD00A67A20 /* MainWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D11E8B01AA0E3DD00A67A20 /* MainWindowController.m */; }; - 2D11E8B41AA0E3DD00A67A20 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2D11E8B11AA0E3DD00A67A20 /* MainWindow.xib */; }; 2D135EF0226E47AA00BAAE84 /* scriptable.c in Sources */ = {isa = PBXBuildFile; fileRef = 2D135EE8226E38AF00BAAE84 /* scriptable.c */; }; 2D135EF1226E47AA00BAAE84 /* scriptable_dsp.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D135EEB226E428C00BAAE84 /* scriptable_dsp.h */; }; 2D135EF2226E47AA00BAAE84 /* scriptable_dsp.c in Sources */ = {isa = PBXBuildFile; fileRef = 2D135EEC226E428C00BAAE84 /* scriptable_dsp.c */; }; @@ -5344,7 +5343,6 @@ 2D11D3C31B9DC69C00C7C731 /* vtxfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vtxfile.c; sourceTree = ""; }; 2D11E8AF1AA0E3DD00A67A20 /* MainWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainWindowController.h; sourceTree = ""; }; 2D11E8B01AA0E3DD00A67A20 /* MainWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainWindowController.m; sourceTree = ""; }; - 2D11E8B11AA0E3DD00A67A20 /* MainWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 2D135EE7226E38AF00BAAE84 /* scriptable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = scriptable.h; sourceTree = ""; }; 2D135EE8226E38AF00BAAE84 /* scriptable.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = scriptable.c; sourceTree = ""; }; 2D135EEB226E428C00BAAE84 /* scriptable_dsp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = scriptable_dsp.h; sourceTree = ""; }; @@ -9787,7 +9785,6 @@ 2D49856E1D5CF0E900E4D985 /* Log.xib */, 2DBF3D3F270868D400023138 /* MainContentViewController.xib */, 2D17F8451AB3391A00AF2853 /* MainMenu.xib */, - 2D11E8B11AA0E3DD00A67A20 /* MainWindow.xib */, 2D3EBD9C1A9379BD00E5E255 /* Preferences.xib */, 2D1A56391D9FF9A4005E5CDD /* ReplayGain.xib */, 2D651D19227227FA00375AE2 /* ScriptableNodeEditorViewController.xib */, @@ -16569,7 +16566,6 @@ 2DC657C32746F67600583E14 /* RenameTabViewController.xib in Resources */, 2DB05EB8252E47A00090635E /* iconNetworkTemplate.pdf in Resources */, 2D17F8461AB3391A00AF2853 /* MainMenu.xib in Resources */, - 2D11E8B41AA0E3DD00A67A20 /* MainWindow.xib in Resources */, 2D9C0C15238DC0E700CE8C10 /* GroupByCustomWindow.xib in Resources */, 2DBCA69D27944BB600D7432F /* ChangeLog in Resources */, 2DC657FC274A7C4600583E14 /* RenamePlaylistViewController.xib in Resources */, @@ -22764,7 +22760,6 @@ GLIB_DISABLE_DEPRECATION_WARNINGS, GTK_DISABLE_DEPRECATION_WARNINGS, "DDB_WARN_DEPRECATED=1", - "ENABLE_MEDIALIB=1", ); GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; @@ -22829,7 +22824,6 @@ GLIB_DISABLE_DEPRECATION_WARNINGS, GTK_DISABLE_DEPRECATION_WARNINGS, "DDB_WARN_DEPRECATED=1", - "ENABLE_MEDIALIB=1", ); GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; @@ -23091,7 +23085,6 @@ GLIB_DISABLE_DEPRECATION_WARNINGS, GTK_DISABLE_DEPRECATION_WARNINGS, "DDB_WARN_DEPRECATED=1", - "ENABLE_MEDIALIB=1", ); GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; @@ -23156,7 +23149,6 @@ GLIB_DISABLE_DEPRECATION_WARNINGS, GTK_DISABLE_DEPRECATION_WARNINGS, "DDB_WARN_DEPRECATED=1", - "ENABLE_MEDIALIB=1", ); GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; @@ -23824,7 +23816,6 @@ "DISABLE_MM_KEY_GRABBER=1", "_DEBUG=1", "DDB_ENABLE_SCRIPTABLE=1", - "ENABLE_MEDIALIB=1", ); GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; @@ -23884,7 +23875,6 @@ "HAVE_LOG2=1", "OSX_APPBUNDLE=1", "DDB_ENABLE_SCRIPTABLE=1", - "ENABLE_MEDIALIB=1", ); GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; diff --git a/plugins/cocoaui/AppDelegate.m b/plugins/cocoaui/AppDelegate.m index 66da197fe5..158107be45 100644 --- a/plugins/cocoaui/AppDelegate.m +++ b/plugins/cocoaui/AppDelegate.m @@ -198,12 +198,8 @@ - (void)awakeFromNib { } - (void)initMainWindow { -#if ENABLE_MEDIALIB _mainWindow = [[MainWindowController alloc] initWithWindowNibName:@"SplitViewMainWindow"]; _mainWindow.mediaLibraryManager = self.mediaLibraryManager; -#else - _mainWindow = [[MainWindowController alloc] initWithWindowNibName:@"MainWindow"]; -#endif _mainWindow.shouldCascadeWindows = NO; _mainWindow.window.releasedWhenClosed = NO; _mainWindow.window.excludedFromWindowsMenu = YES; diff --git a/plugins/cocoaui/MainWindowController.h b/plugins/cocoaui/MainWindowController.h index 27dd9c4f6c..a286d87d65 100644 --- a/plugins/cocoaui/MainWindowController.h +++ b/plugins/cocoaui/MainWindowController.h @@ -29,9 +29,7 @@ @protocol WidgetProtocol; -#ifdef ENABLE_MEDIALIB @class MediaLibraryManager; -#endif @interface MainWindowController : NSWindowController @@ -41,9 +39,7 @@ @property (strong) IBOutlet MainWindowSidebarViewController *sidebarOutlineViewController; @property (unsafe_unretained) IBOutlet NSSegmentedControl *buttonBar; -#ifdef ENABLE_MEDIALIB @property (nonatomic) MediaLibraryManager *mediaLibraryManager; -#endif - (IBAction)seekBarAction:(id)sender; - (IBAction)volumeBarAction:(id)sender; diff --git a/plugins/cocoaui/MainWindowController.m b/plugins/cocoaui/MainWindowController.m index f087c4c935..ff6e9ff4cb 100644 --- a/plugins/cocoaui/MainWindowController.m +++ b/plugins/cocoaui/MainWindowController.m @@ -28,9 +28,7 @@ #import "DesignModeState.h" #import "GuiPreferencesWindowController.h" #import "MainWindowController.h" -#ifdef ENABLE_MEDIALIB #import "MediaLibraryManager.h" -#endif #import "PlaylistWidget.h" #import "PlaylistWithTabsWidget.h" #import "PreferencesWindowController.h" @@ -121,7 +119,6 @@ - (void)windowDidLoad { } #endif -#if ENABLE_MEDIALIB self.playlistWithTabsView = self.splitViewController.bodyViewController.wrapperView; self.designableContainerView = self.splitViewController.bodyViewController.designableView; @@ -148,19 +145,6 @@ - (void)windowDidLoad { } } -#else - self.mainContentViewController = [MainContentViewController new]; - [self.designableContainerView addSubview:self.mainContentViewController.view]; - [NSLayoutConstraint activateConstraints:@[ - [self.designableContainerView.topAnchor constraintEqualToAnchor:self.mainContentViewController.view.topAnchor], - [self.designableContainerView.bottomAnchor constraintEqualToAnchor:self.mainContentViewController.view.bottomAnchor], - [self.designableContainerView.leadingAnchor constraintEqualToAnchor:self.mainContentViewController.view.leadingAnchor], - [self.designableContainerView.trailingAnchor constraintEqualToAnchor:self.mainContentViewController.view.trailingAnchor], - ]]; - - self.designableContainerView = self.mainContentViewController.designableView; -#endif - id rootWidget = DesignModeState.sharedInstance.rootWidget; NSView *view = rootWidget.view; view.translatesAutoresizingMaskIntoConstraints = NO; @@ -560,16 +544,13 @@ - (void)deletePlaylistDone:(DeletePlaylistConfirmationController *)controller { #pragma mark - ScriptableSelectDelegate - (void)scriptableSelectItemSelected:(scriptableItem_t *)item { -#if ENABLE_MEDIALIB const char *name = scriptableItemPropertyValueForKey(item, "name"); self.mediaLibraryManager.preset = @(name); -#endif } #pragma mark - ScriptableItemDelegate - (void)scriptableItemDidChange:(scriptableItem_t *)scriptable change:(ScriptableItemChange)change { -#if ENABLE_MEDIALIB dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.tfQuerySelectViewController reloadData]; @@ -586,7 +567,6 @@ - (void)scriptableItemDidChange:(scriptableItem_t *)scriptable change:(Scriptabl [self scriptableSelectItemSelected:item]; } }); -#endif } @end diff --git a/plugins/cocoaui/Preferences/PreferencesWindowController.m b/plugins/cocoaui/Preferences/PreferencesWindowController.m index 6a8f04b474..22d275f90e 100644 --- a/plugins/cocoaui/Preferences/PreferencesWindowController.m +++ b/plugins/cocoaui/Preferences/PreferencesWindowController.m @@ -69,9 +69,7 @@ - (void)windowDidLoad { BOOL enableMedialib = NO; -#if ENABLE_MEDIALIB enableMedialib = self.mediaLibraryPreferencesViewController.isAvailable; -#endif if (!enableMedialib) { [self.toolbar removeItemAtIndex:4]; diff --git a/plugins/cocoaui/SplitViewMainWindow/MainWindowSidebarViewController.m b/plugins/cocoaui/SplitViewMainWindow/MainWindowSidebarViewController.m index bc73037614..3d0b27a655 100644 --- a/plugins/cocoaui/SplitViewMainWindow/MainWindowSidebarViewController.m +++ b/plugins/cocoaui/SplitViewMainWindow/MainWindowSidebarViewController.m @@ -27,9 +27,7 @@ - (void)close { - (void)viewDidLoad { [super viewDidLoad]; -#if ENABLE_MEDIALIB self.mediaLibraryOutlineViewController = [[MediaLibraryOutlineViewController alloc] initWithOutlineView:self.outlineView searchField:self.searchField]; -#endif } diff --git a/plugins/cocoaui/XIB/MainWindow.xib b/plugins/cocoaui/XIB/MainWindow.xib deleted file mode 100644 index 4466bae4c8..0000000000 --- a/plugins/cocoaui/XIB/MainWindow.xib +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/cocoaui/XIB/SplitViewMainWindow.xib b/plugins/cocoaui/XIB/SplitViewMainWindow.xib index c437cda8bb..ccf4697595 100644 --- a/plugins/cocoaui/XIB/SplitViewMainWindow.xib +++ b/plugins/cocoaui/XIB/SplitViewMainWindow.xib @@ -1,8 +1,8 @@ - + - + diff --git a/plugins/gtkui/Makefile.am b/plugins/gtkui/Makefile.am index 7aad02aef3..80037fb6db 100644 --- a/plugins/gtkui/Makefile.am +++ b/plugins/gtkui/Makefile.am @@ -69,10 +69,6 @@ GTKUI_SOURCES = \ sdkdir = $(pkgincludedir) sdk_HEADERS = gtkui_api.h -if HAVE_MEDIALIB -MEDIALIB_CFLAGS = -DENABLE_MEDIALIB=1 -endif - if STATICLINK if HAVE_GTK2 if HAVE_GTK3 diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 90b1923f75..23b4a54512 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -130,9 +130,7 @@ static char *titlebar_stopped_bc; static char *statusbar_bc; static char *statusbar_stopped_bc; -enum { - INFO_TARGET_URIS -}; +enum { INFO_TARGET_URIS }; static void init_widget_layout (void); @@ -192,12 +190,10 @@ update_songinfo (gpointer unused) { DB_playItem_t *track = deadbeef->streamer_get_playing_track_safe (); - ddb_tf_context_t ctx = { - ._size = sizeof (ddb_tf_context_t), - .it = track, - .iter = PL_MAIN, - .plt = deadbeef->plt_get_curr () - }; + ddb_tf_context_t ctx = { ._size = sizeof (ddb_tf_context_t), + .it = track, + .iter = PL_MAIN, + .plt = deadbeef->plt_get_curr () }; char buffer[200]; char *bc = NULL; @@ -210,7 +206,14 @@ update_songinfo (gpointer unused) { } deadbeef->tf_eval (&ctx, bc, buffer, sizeof (buffer)); - snprintf (sbtext_new, sizeof (sbtext_new), "%s | %d tracks | %s %s", buffer, deadbeef->pl_getcount (PL_MAIN), totaltime_str, _ ("total playtime")); + snprintf ( + sbtext_new, + sizeof (sbtext_new), + "%s | %d tracks | %s %s", + buffer, + deadbeef->pl_getcount (PL_MAIN), + totaltime_str, + _ ("total playtime")); if (strcmp (sbtext_new, sb_text)) { strcpy (sb_text, sbtext_new); @@ -401,9 +404,11 @@ gtkui_titlebar_tf_init (void) { deadbeef->conf_get_str ("gtkui.titlebar_stopped_tf", gtkui_default_titlebar_stopped, fmt, sizeof (fmt)); titlebar_stopped_bc = deadbeef->tf_compile (fmt); - static const char statusbar_tf_with_seltime_fmt[] = "$if2($strcmp(%%ispaused%%,),%s | )$if2($upper(%%codec%%),-) |[ %%playback_bitrate%% kbps |][ %%samplerate%%Hz |][ %%:BPS%% %s |][ %%channels%% |] %%playback_time%% / %%length%% | %%selection_playback_time%% %s"; + static const char statusbar_tf_with_seltime_fmt[] = + "$if2($strcmp(%%ispaused%%,),%s | )$if2($upper(%%codec%%),-) |[ %%playback_bitrate%% kbps |][ %%samplerate%%Hz |][ %%:BPS%% %s |][ %%channels%% |] %%playback_time%% / %%length%% | %%selection_playback_time%% %s"; - static const char statusbar_tf_fmt[] = "$if2($strcmp(%%ispaused%%,),%s | )$if2($upper(%%codec%%),-) |[ %%playback_bitrate%% kbps |][ %%samplerate%%Hz |][ %%:BPS%% %s |][ %%channels%% |] %%playback_time%% / %%length%%"; + static const char statusbar_tf_fmt[] = + "$if2($strcmp(%%ispaused%%,),%s | )$if2($upper(%%codec%%),-) |[ %%playback_bitrate%% kbps |][ %%samplerate%%Hz |][ %%:BPS%% %s |][ %%channels%% |] %%playback_time%% / %%length%%"; const char statusbar_stopped_tf_with_seltime_fmt[] = "%s | %%selection_playback_time%% %s"; const char statusbar_stopped_tf_fmt[] = "%s"; @@ -412,8 +417,19 @@ gtkui_titlebar_tf_init (void) { char statusbar_stopped_tf[1024]; if (deadbeef->conf_get_int ("gtkui.statusbar_seltime", 0)) { - snprintf (statusbar_tf, sizeof (statusbar_tf), statusbar_tf_with_seltime_fmt, _ ("Paused"), _ ("bit"), _ ("selection playtime")); - snprintf (statusbar_stopped_tf, sizeof (statusbar_stopped_tf), statusbar_stopped_tf_with_seltime_fmt, _ ("Stopped"), _ ("selection playtime")); + snprintf ( + statusbar_tf, + sizeof (statusbar_tf), + statusbar_tf_with_seltime_fmt, + _ ("Paused"), + _ ("bit"), + _ ("selection playtime")); + snprintf ( + statusbar_stopped_tf, + sizeof (statusbar_stopped_tf), + statusbar_stopped_tf_with_seltime_fmt, + _ ("Stopped"), + _ ("selection playtime")); } else { snprintf (statusbar_tf, sizeof (statusbar_tf), statusbar_tf_fmt, _ ("Paused"), _ ("bit")); @@ -607,8 +623,16 @@ gtkui_remove_playlist (ddb_playlist_t *plt) { if (deadbeef->plt_get_first (plt, PL_MAIN) != NULL) { // playlist not empty, confirm first. deadbeef->plt_get_title (plt, title, sizeof (title)); - GtkWidget *dlg = gtk_message_dialog_new (GTK_WINDOW (mainwin), GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_YES_NO, _ ("Removing playlist")); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg), _ ("Do you really want to remove the playlist '%s'?"), title); + GtkWidget *dlg = gtk_message_dialog_new ( + GTK_WINDOW (mainwin), + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_YES_NO, + _ ("Removing playlist")); + gtk_message_dialog_format_secondary_text ( + GTK_MESSAGE_DIALOG (dlg), + _ ("Do you really want to remove the playlist '%s'?"), + title); gtk_window_set_title (GTK_WINDOW (dlg), _ ("Warning")); int response = gtk_dialog_run (GTK_DIALOG (dlg)); gtk_widget_destroy (dlg); @@ -670,18 +694,26 @@ gtkui_on_configchanged (void *data) { gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, w)), TRUE); // scroll follows playback - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "scroll_follows_playback")), deadbeef->conf_get_int ("playlist.scroll.followplayback", 1) ? TRUE : FALSE); + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "scroll_follows_playback")), + deadbeef->conf_get_int ("playlist.scroll.followplayback", 1) ? TRUE : FALSE); // cursor follows playback - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "cursor_follows_playback")), deadbeef->conf_get_int ("playlist.scroll.cursorfollowplayback", 1) ? TRUE : FALSE); + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "cursor_follows_playback")), + deadbeef->conf_get_int ("playlist.scroll.cursorfollowplayback", 1) ? TRUE : FALSE); // stop after current track int stop_after_current = deadbeef->conf_get_int ("playlist.stop_after_current", 0); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "stop_after_current")), stop_after_current ? TRUE : FALSE); + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "stop_after_current")), + stop_after_current ? TRUE : FALSE); // stop after current album int stop_after_album = deadbeef->conf_get_int ("playlist.stop_after_album", 0); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "stop_after_album")), stop_after_album ? TRUE : FALSE); + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "stop_after_album")), + stop_after_album ? TRUE : FALSE); gtkui_embolden_current_track = deadbeef->conf_get_int ("gtkui.embolden_current_track", 0); gtkui_embolden_tracks = deadbeef->conf_get_int ("gtkui.embolden_tracks", 0); @@ -803,10 +835,18 @@ add_mainmenu_actions_cb (void *data) { } int -gtkui_plt_add_dir (ddb_playlist_t *plt, const char *dirname, int (*cb) (DB_playItem_t *it, void *data), void *user_data); +gtkui_plt_add_dir ( + ddb_playlist_t *plt, + const char *dirname, + int (*cb) (DB_playItem_t *it, void *data), + void *user_data); int -gtkui_plt_add_file (ddb_playlist_t *plt, const char *filename, int (*cb) (DB_playItem_t *it, void *data), void *user_data); +gtkui_plt_add_file ( + ddb_playlist_t *plt, + const char *filename, + int (*cb) (DB_playItem_t *it, void *data), + void *user_data); int gtkui_pl_add_files_begin (ddb_playlist_t *plt); @@ -815,7 +855,13 @@ void gtkui_pl_add_files_end (void); DB_playItem_t * -gtkui_plt_load (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pabort, int (*cb) (DB_playItem_t *it, void *data), void *user_data); +gtkui_plt_load ( + ddb_playlist_t *plt, + DB_playItem_t *after, + const char *fname, + int *pabort, + int (*cb) (DB_playItem_t *it, void *data), + void *user_data); static int is_current_playlist (DB_playItem_t *it) { @@ -852,7 +898,8 @@ playlist_set_intended_scroll (DB_playItem_t *it) { static gboolean pre_songstarted_cb (gpointer data) { DB_playItem_t *it = data; - if ((!gtkui_listview_busy || !is_current_playlist (it)) && deadbeef->conf_get_int ("playlist.scroll.followplayback", 1)) { + if ((!gtkui_listview_busy || !is_current_playlist (it)) && + deadbeef->conf_get_int ("playlist.scroll.followplayback", 1)) { playlist_set_intended_scroll (it); } deadbeef->pl_item_unref (it); @@ -874,7 +921,8 @@ static void playlist_set_cursor (ddb_playlist_t *plt, DB_playItem_t *it) { int idx = deadbeef->plt_get_item_idx (plt, it, PL_MAIN); if (idx != -1) { - if (deadbeef->pl_is_selected (it) || idx != deadbeef->plt_get_cursor (plt, PL_MAIN) || deadbeef->plt_getselcount (plt) != 1) { + if (deadbeef->pl_is_selected (it) || idx != deadbeef->plt_get_cursor (plt, PL_MAIN) || + deadbeef->plt_getselcount (plt) != 1) { deadbeef->plt_deselect_all (plt); deadbeef->pl_set_selected (it, 1); deadbeef->plt_set_cursor (plt, PL_MAIN, idx); @@ -889,7 +937,8 @@ playlist_set_cursor (ddb_playlist_t *plt, DB_playItem_t *it) { static gboolean songstarted_cb (gpointer data) { DB_playItem_t *it = data; - if ((!gtkui_listview_busy || !is_current_playlist (it)) && deadbeef->conf_get_int ("playlist.scroll.cursorfollowplayback", 1)) { + if ((!gtkui_listview_busy || !is_current_playlist (it)) && + deadbeef->conf_get_int ("playlist.scroll.cursorfollowplayback", 1)) { deadbeef->pl_lock (); ddb_playlist_t *plt = deadbeef->pl_get_playlist (it); if (plt) { @@ -1142,7 +1191,8 @@ init_widget_layout (void) { // config var name is defined in DDB_GTKUI_CONF_LAYOUT // gtkui.layout.major.minor.point: later versions - static const char *gtkui_def_layout = "{\"type\":\"vbox\",\"legacy_params\":\"expand=\\\"0 1\\\" fill=\\\"1 1\\\" homogeneous=0\",\"children\":[{\"type\":\"hbox\",\"legacy_params\":\"expand=\\\"0 1 0\\\" fill=\\\"1 1 1\\\" homogeneous=0\",\"children\":[{\"type\":\"playtb\"},{\"type\":\"seekbar\"},{\"type\":\"volumebar\",\"legacy_params\":\"scale=0\"}]},{\"type\":\"tabbed_playlist\",\"legacy_params\":\"hideheaders=0\"}]}"; + static const char *gtkui_def_layout = + "{\"type\":\"vbox\",\"legacy_params\":\"expand=\\\"0 1\\\" fill=\\\"1 1\\\" homogeneous=0\",\"children\":[{\"type\":\"hbox\",\"legacy_params\":\"expand=\\\"0 1 0\\\" fill=\\\"1 1 1\\\" homogeneous=0\",\"children\":[{\"type\":\"playtb\"},{\"type\":\"seekbar\"},{\"type\":\"volumebar\",\"legacy_params\":\"scale=0\"}]},{\"type\":\"tabbed_playlist\",\"legacy_params\":\"hideheaders=0\"}]}"; json_t *layout = NULL; @@ -1266,7 +1316,10 @@ static int window_init_hooks_count; static void add_window_init_hook (void (*callback) (void *userdata), void *userdata) { if (window_init_hooks_count >= WINDOW_INIT_HOOK_MAX) { - fprintf (stderr, "gtkui: add_window_init_hook can't add another hook, maximum number of hooks (%d) exceeded\n", (int)WINDOW_INIT_HOOK_MAX); + fprintf ( + stderr, + "gtkui: add_window_init_hook can't add another hook, maximum number of hooks (%d) exceeded\n", + (int)WINDOW_INIT_HOOK_MAX); return; } @@ -1323,8 +1376,7 @@ static int logwindow_scroll_bottomed = 1; void logwindow_scroll_changed (GtkAdjustment *adjustment, gpointer user_data) { if (gtk_adjustment_get_value (adjustment) >= - gtk_adjustment_get_upper (adjustment) - - gtk_adjustment_get_page_size (adjustment) - 1e-12) { + gtk_adjustment_get_upper (adjustment) - gtk_adjustment_get_page_size (adjustment) - 1e-12) { logwindow_scroll_bottomed = 1; } else { @@ -1392,7 +1444,13 @@ logwindow_logger_callback (struct DB_plugin_s *plugin, uint32_t layers, const ch } static gboolean -gtkui_mainwin_drag_motion (GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time, gpointer user_data) { +gtkui_mainwin_drag_motion ( + GtkWidget *widget, + GdkDragContext *drag_context, + gint x, + gint y, + guint time, + gpointer user_data) { // Don't allow drag from within application if (gtk_drag_get_source_widget (drag_context)) { gdk_drag_status (drag_context, 0, time); @@ -1402,7 +1460,15 @@ gtkui_mainwin_drag_motion (GtkWidget *widget, GdkDragContext *drag_context, gint } static void -gtkui_mainwin_drag_data_received (GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, GtkSelectionData *data, guint target_type, guint time, gpointer user_data) { +gtkui_mainwin_drag_data_received ( + GtkWidget *widget, + GdkDragContext *drag_context, + gint x, + gint y, + GtkSelectionData *data, + guint target_type, + guint time, + gpointer user_data) { gchar *ptr = (char *)gtk_selection_data_get_data (data); gint len = gtk_selection_data_get_length (data); if (target_type == INFO_TARGET_URIS) { // uris @@ -1429,7 +1495,12 @@ gtkui_mainwin_init (void) { w_reg_widget (NULL, 0, w_placeholder_create, "placeholder", NULL); w_reg_widget (_ ("Tabs"), DDB_WF_SUPPORTS_EXTENDED_API, w_tabs_create, "tabs", NULL); w_reg_widget (_ ("Playlist tabs"), 0, w_tabstrip_create, "tabstrip", NULL); - w_reg_widget (_ ("Selection properties"), DDB_WF_SUPPORTS_EXTENDED_API, w_selproperties_create, "selproperties", NULL); + w_reg_widget ( + _ ("Selection properties"), + DDB_WF_SUPPORTS_EXTENDED_API, + w_selproperties_create, + "selproperties", + NULL); w_reg_widget (_ ("Album art display"), DDB_WF_SUPPORTS_EXTENDED_API, w_albumart_create, "coverart", NULL); w_reg_widget (_ ("Oscilloscope"), DDB_WF_SUPPORTS_EXTENDED_API, w_scope_create, "scope", NULL); w_reg_widget (_ ("Spectrum"), DDB_WF_SUPPORTS_EXTENDED_API, w_spectrum_create, "spectrum", NULL); @@ -1441,9 +1512,7 @@ gtkui_mainwin_init (void) { w_reg_widget (_ ("Volume bar"), DDB_WF_SUPPORTS_EXTENDED_API, w_volumebar_create, "volumebar", NULL); w_reg_widget (_ ("Chiptune voices"), 0, w_ctvoices_create, "ctvoices", NULL); w_reg_widget (_ ("Log viewer"), 0, w_logviewer_create, "logviewer", NULL); -#if ENABLE_MEDIALIB w_reg_widget (_ ("Media library viewer"), 0, w_medialib_viewer_create, "medialibviewer", NULL); -#endif mainwin = create_mainwin (); @@ -1505,7 +1574,11 @@ gtkui_mainwin_init (void) { snprintf (iconpath, sizeof (iconpath), "%s/deadbeef.png", deadbeef->get_system_dir (DDB_SYS_DIR_PREFIX)); struct stat st = { 0 }; if (stat (iconpath, &st)) { - snprintf (iconpath, sizeof (iconpath), "%s/deadbeef.png", deadbeef->get_system_dir (DDB_SYS_DIR_PLUGIN_RESOURCES)); + snprintf ( + iconpath, + sizeof (iconpath), + "%s/deadbeef.png", + deadbeef->get_system_dir (DDB_SYS_DIR_PLUGIN_RESOURCES)); } if (!stat (iconpath, &st)) { gtk_window_set_icon_from_file (GTK_WINDOW (mainwin), iconpath, NULL); @@ -1551,7 +1624,8 @@ gtkui_mainwin_init (void) { gtkui_set_titlebar (NULL); fileadded_listener_id = deadbeef->listen_file_added (gtkui_add_file_info_cb, NULL); - fileadd_beginend_listener_id = deadbeef->listen_file_add_beginend (gtkui_add_file_begin_cb, gtkui_add_file_end_cb, NULL); + fileadd_beginend_listener_id = + deadbeef->listen_file_add_beginend (gtkui_add_file_begin_cb, gtkui_add_file_end_cb, NULL); supereq_plugin = deadbeef->plug_get_for_id ("supereq"); @@ -1662,16 +1736,17 @@ gtkui_show_info_window (const char *fname, const char *title, GtkWidget **pwindo gtk_widget_show (widget); } -typedef enum { - SHUTDOWN_INHIBIT, - SHUTDOWN_NORMAL, - SHUTDOWN_FORCE -} shutdown_type; +typedef enum { SHUTDOWN_INHIBIT, SHUTDOWN_NORMAL, SHUTDOWN_FORCE } shutdown_type; static shutdown_type _should_allow_shutdown (void) { if (deadbeef->have_background_jobs ()) { - GtkWidget *dlg = gtk_message_dialog_new (GTK_WINDOW (mainwin), GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_YES_NO, _ ("The player is currently running background tasks. If you quit now, the tasks will be cancelled or interrupted. This may result in data loss.")); + GtkWidget *dlg = gtk_message_dialog_new ( + GTK_WINDOW (mainwin), + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_YES_NO, + _ ("The player is currently running background tasks. If you quit now, the tasks will be cancelled or interrupted. This may result in data loss.")); gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (mainwin)); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg), _ ("Do you still want to quit?")); gtk_window_set_title (GTK_WINDOW (dlg), _ ("Warning")); @@ -1752,7 +1827,12 @@ gapplication_shutdown_handler (GApplication *app, gpointer user_data) { static int gtkui_start (void) { - fprintf (stderr, "gtkui plugin compiled for gtk version: %d.%d.%d\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + fprintf ( + stderr, + "gtkui plugin compiled for gtk version: %d.%d.%d\n", + GTK_MAJOR_VERSION, + GTK_MINOR_VERSION, + GTK_MICRO_VERSION); import_legacy_tf ("gtkui.titlebar_playing", "gtkui.titlebar_playing_tf"); import_legacy_tf ("gtkui.titlebar_stopped", "gtkui.titlebar_stopped_tf"); @@ -1824,13 +1904,12 @@ gtkui_get_mainwin (void) { return mainwin; } -static DB_plugin_action_t action_rg_remove_info = { - .title = "ReplayGain/Remove ReplayGain Information", - .name = "rg_remove_info", - .flags = DB_ACTION_SINGLE_TRACK | DB_ACTION_MULTIPLE_TRACKS | DB_ACTION_ADD_MENU, - .callback2 = action_rg_remove_info_handler, - .next = NULL -}; +static DB_plugin_action_t action_rg_remove_info = { .title = "ReplayGain/Remove ReplayGain Information", + .name = "rg_remove_info", + .flags = DB_ACTION_SINGLE_TRACK | DB_ACTION_MULTIPLE_TRACKS | + DB_ACTION_ADD_MENU, + .callback2 = action_rg_remove_info_handler, + .next = NULL }; static DB_plugin_action_t action_rg_scan_selection_as_albums = { .title = "ReplayGain/Scan Selection As Albums (By Tags)", @@ -1840,21 +1919,19 @@ static DB_plugin_action_t action_rg_scan_selection_as_albums = { .next = &action_rg_remove_info }; -static DB_plugin_action_t action_rg_scan_selection_as_album = { - .title = "ReplayGain/Scan Selection As Single Album", - .name = "rg_scan_selection_as_album", - .flags = DB_ACTION_SINGLE_TRACK | DB_ACTION_MULTIPLE_TRACKS | DB_ACTION_ADD_MENU, - .callback2 = action_rg_scan_selection_as_album_handler, - .next = &action_rg_scan_selection_as_albums -}; +static DB_plugin_action_t action_rg_scan_selection_as_album = { .title = "ReplayGain/Scan Selection As Single Album", + .name = "rg_scan_selection_as_album", + .flags = DB_ACTION_SINGLE_TRACK | + DB_ACTION_MULTIPLE_TRACKS | DB_ACTION_ADD_MENU, + .callback2 = action_rg_scan_selection_as_album_handler, + .next = &action_rg_scan_selection_as_albums }; -static DB_plugin_action_t action_rg_scan_per_file = { - .title = "ReplayGain/Scan Per-file Track Gain", - .name = "rg_scan_perfile_track_gain", - .flags = DB_ACTION_SINGLE_TRACK | DB_ACTION_MULTIPLE_TRACKS | DB_ACTION_ADD_MENU, - .callback2 = action_rg_scan_per_file_handler, - .next = &action_rg_scan_selection_as_album -}; +static DB_plugin_action_t action_rg_scan_per_file = { .title = "ReplayGain/Scan Per-file Track Gain", + .name = "rg_scan_perfile_track_gain", + .flags = DB_ACTION_SINGLE_TRACK | DB_ACTION_MULTIPLE_TRACKS | + DB_ACTION_ADD_MENU, + .callback2 = action_rg_scan_per_file_handler, + .next = &action_rg_scan_selection_as_album }; static DB_plugin_action_t action_scan_all_tracks_without_rg = { .title = "ReplayGain/Scan Per-file Track Gain If Not Scanned", @@ -1864,333 +1941,253 @@ static DB_plugin_action_t action_scan_all_tracks_without_rg = { .next = &action_rg_scan_per_file }; -static DB_plugin_action_t action_deselect_all = { - .title = "Edit/Deselect All", - .name = "deselect_all", - .flags = DB_ACTION_COMMON, - .callback2 = action_deselect_all_handler, - .next = &action_scan_all_tracks_without_rg -}; - -static DB_plugin_action_t action_select_all = { - .title = "Edit/Select All", - .name = "select_all", - .flags = DB_ACTION_COMMON, - .callback2 = action_select_all_handler, - .next = &action_deselect_all -}; - -static DB_plugin_action_t action_quit = { - .title = "Quit", - .name = "quit", - .flags = DB_ACTION_COMMON, - .callback2 = action_quit_handler, - .next = &action_select_all -}; - -static DB_plugin_action_t action_delete_from_disk = { - .title = "Delete from Disk", - .name = "delete_from_disk", - .flags = DB_ACTION_MULTIPLE_TRACKS, - .callback2 = action_delete_from_disk_handler, - .next = &action_quit -}; - -static DB_plugin_action_t action_add_location = { - .title = "File/Add Location", - .name = "add_location", - .flags = DB_ACTION_COMMON, - .callback2 = action_add_location_handler, - .next = &action_delete_from_disk -}; - -static DB_plugin_action_t action_add_folders = { - .title = "File/Add Folder(s)", - .name = "add_folders", - .flags = DB_ACTION_COMMON, - .callback2 = action_add_folders_handler, - .next = &action_add_location -}; - -static DB_plugin_action_t action_add_files = { - .title = "File/Add File(s)", - .name = "add_files", - .flags = DB_ACTION_COMMON, - .callback2 = action_add_files_handler, - .next = &action_add_folders -}; - -static DB_plugin_action_t action_open_files = { - .title = "File/Open File(s)", - .name = "open_files", - .flags = DB_ACTION_COMMON, - .callback2 = action_open_files_handler, - .next = &action_add_files -}; - -static DB_plugin_action_t action_track_properties = { - .title = "Track Properties", - .name = "track_properties", - .flags = DB_ACTION_MULTIPLE_TRACKS, - .callback2 = action_show_track_properties_handler, - .next = &action_open_files -}; - -static DB_plugin_action_t action_show_help = { - .title = "Help/Show Help Page", - .name = "help", - .flags = DB_ACTION_COMMON, - .callback2 = action_show_help_handler, - .next = &action_track_properties -}; - -static DB_plugin_action_t action_playback_loop_cycle = { - .title = "Playback/Cycle Repeat Mode", - .name = "loop_cycle", - .flags = DB_ACTION_COMMON, - .callback2 = action_playback_loop_cycle_handler, - .next = &action_show_help -}; - -static DB_plugin_action_t action_playback_loop_off = { - .title = "Playback/Repeat - Off", - .name = "loop_off", - .flags = DB_ACTION_COMMON, - .callback2 = action_playback_loop_off_handler, - .next = &action_playback_loop_cycle -}; - -static DB_plugin_action_t action_playback_loop_single = { - .title = "Playback/Repeat - Single Track", - .name = "loop_track", - .flags = DB_ACTION_COMMON, - .callback2 = action_playback_loop_single_handler, - .next = &action_playback_loop_off -}; - -static DB_plugin_action_t action_playback_loop_all = { - .title = "Playback/Repeat - All", - .name = "loop_all", - .flags = DB_ACTION_COMMON, - .callback2 = action_playback_loop_all_handler, - .next = &action_playback_loop_single -}; - -static DB_plugin_action_t action_playback_order_cycle = { - .title = "Playback/Cycle Shuffle Mode", - .name = "order_cycle", - .flags = DB_ACTION_COMMON, - .callback2 = action_playback_order_cycle_handler, - .next = &action_playback_loop_all -}; - -static DB_plugin_action_t action_playback_order_random = { - .title = "Playback/Shuffle - Random Tracks", - .name = "order_random", - .flags = DB_ACTION_COMMON, - .callback2 = action_playback_order_random_handler, - .next = &action_playback_order_cycle -}; - -static DB_plugin_action_t action_playback_order_shuffle_albums = { - .title = "Playback/Shuffle - Albums", - .name = "order_shuffle_albums", - .flags = DB_ACTION_COMMON, - .callback2 = action_playback_order_shuffle_albums_handler, - .next = &action_playback_order_random -}; - -static DB_plugin_action_t action_playback_order_shuffle = { - .title = "Playback/Shuffle - Tracks", - .name = "order_shuffle", - .flags = DB_ACTION_COMMON, - .callback2 = action_playback_order_shuffle_handler, - .next = &action_playback_order_shuffle_albums -}; - -static DB_plugin_action_t action_playback_order_linear = { - .title = "Playback/Shuffle - Off", - .name = "order_linear", - .flags = DB_ACTION_COMMON, - .callback2 = action_playback_order_linear_handler, - .next = &action_playback_order_shuffle -}; - -static DB_plugin_action_t action_cursor_follows_playback = { - .title = "Playback/Toggle Cursor Follows Playback", - .name = "toggle_cursor_follows_playback", - .flags = DB_ACTION_COMMON, - .callback2 = action_cursor_follows_playback_handler, - .next = &action_playback_order_linear -}; - -static DB_plugin_action_t action_scroll_follows_playback = { - .title = "Playback/Toggle Scroll Follows Playback", - .name = "toggle_scroll_follows_playback", - .flags = DB_ACTION_COMMON, - .callback2 = action_scroll_follows_playback_handler, - .next = &action_cursor_follows_playback -}; - -static DB_plugin_action_t action_toggle_menu = { - .title = "View/Show\\/Hide menu", - .name = "toggle_menu", - .flags = DB_ACTION_COMMON, - .callback2 = action_toggle_menu_handler, - .next = &action_scroll_follows_playback -}; - -static DB_plugin_action_t action_toggle_statusbar = { - .title = "View/Show\\/Hide statusbar", - .name = "toggle_statusbar", - .flags = DB_ACTION_COMMON, - .callback2 = action_toggle_statusbar_handler, - .next = &action_toggle_menu -}; - -static DB_plugin_action_t action_toggle_designmode = { - .title = "Edit/Toggle Design Mode", - .name = "toggle_design_mode", - .flags = DB_ACTION_COMMON, - .callback2 = action_toggle_designmode_handler, - .next = &action_toggle_statusbar -}; - -static DB_plugin_action_t action_preferences = { - .title = "Edit/Preferences", - .name = "preferences", - .flags = DB_ACTION_COMMON, - .callback2 = action_preferences_handler, - .next = &action_toggle_designmode -}; - -static DB_plugin_action_t action_sort_custom = { - .title = "Edit/Sort Custom", - .name = "sort_custom", - .flags = DB_ACTION_COMMON, - .callback2 = action_sort_custom_handler, - .next = &action_preferences -}; - -static DB_plugin_action_t action_crop_selected = { - .title = "Edit/Crop Selected", - .name = "crop_selected", - .flags = DB_ACTION_COMMON, - .callback2 = action_crop_selected_handler, - .next = &action_sort_custom -}; - -static DB_plugin_action_t action_remove_from_playlist = { - .title = "Edit/Remove Track(s) from Playlist", - .name = "remove_from_playlist", - .flags = DB_ACTION_MULTIPLE_TRACKS | DB_ACTION_EXCLUDE_FROM_CTX_PLAYLIST, - .callback2 = action_remove_from_playlist_handler, - .next = &action_crop_selected -}; - -static DB_plugin_action_t action_save_playlist = { - .title = "File/Save Playlist", - .name = "save_playlist", - .flags = DB_ACTION_COMMON, - .callback2 = action_save_playlist_handler, - .next = &action_remove_from_playlist -}; - -static DB_plugin_action_t action_load_playlist = { - .title = "File/Load Playlist", - .name = "load_playlist", - .flags = DB_ACTION_COMMON, - .callback2 = action_load_playlist_handler, - .next = &action_save_playlist -}; - -static DB_plugin_action_t action_remove_current_playlist = { - .title = "File/Remove Current Playlist", - .name = "remove_current_playlist", - .flags = DB_ACTION_COMMON, - .callback2 = action_remove_current_playlist_handler, - .next = &action_load_playlist -}; - -static DB_plugin_action_t action_new_playlist = { - .title = "File/New Playlist", - .name = "new_playlist", - .flags = DB_ACTION_COMMON, - .callback2 = action_new_playlist_handler, - .next = &action_remove_current_playlist -}; - -static DB_plugin_action_t action_rename_current_playlist = { - .title = "File/Rename Current Playlist", - .name = "rename_current_playlist", - .flags = DB_ACTION_COMMON, - .callback2 = action_rename_current_playlist_handler, - .next = &action_new_playlist -}; - -static DB_plugin_action_t action_toggle_eq = { - .title = "View/Show\\/Hide Equalizer", - .name = "toggle_eq", - .flags = DB_ACTION_COMMON, - .callback2 = action_toggle_eq_handler, - .next = &action_rename_current_playlist -}; - -static DB_plugin_action_t action_hide_eq = { - .title = "View/Hide Equalizer", - .name = "hide_eq", - .flags = DB_ACTION_COMMON, - .callback2 = action_hide_eq_handler, - .next = &action_toggle_eq -}; - -static DB_plugin_action_t action_show_eq = { - .title = "View/Show Equalizer", - .name = "show_eq", - .flags = DB_ACTION_COMMON, - .callback2 = action_show_eq_handler, - .next = &action_hide_eq -}; - -static DB_plugin_action_t action_toggle_mainwin = { - .title = "View/Show\\/Hide Player Window", - .name = "toggle_player_window", - .flags = DB_ACTION_COMMON, - .callback2 = action_toggle_mainwin_handler, - .next = &action_show_eq -}; - -static DB_plugin_action_t action_hide_mainwin = { - .title = "View/Hide Player Window", - .name = "hide_player_window", - .flags = DB_ACTION_COMMON, - .callback2 = action_hide_mainwin_handler, - .next = &action_toggle_mainwin -}; - -static DB_plugin_action_t action_show_mainwin = { - .title = "View/Show Player Window", - .name = "show_player_window", - .flags = DB_ACTION_COMMON, - .callback2 = action_show_mainwin_handler, - .next = &action_hide_mainwin -}; - -static DB_plugin_action_t action_find = { - .title = "Edit/Find", - .name = "find", - .flags = DB_ACTION_COMMON, - .callback2 = action_find_handler, - .next = &action_show_mainwin -}; - -static DB_plugin_action_t action_view_log = { - .title = "View/Show\\/Hide Log window", - .name = "toggle_log_window", - .flags = DB_ACTION_COMMON, - .callback2 = action_toggle_logwindow_handler, - .next = &action_find -}; +static DB_plugin_action_t action_deselect_all = { .title = "Edit/Deselect All", + .name = "deselect_all", + .flags = DB_ACTION_COMMON, + .callback2 = action_deselect_all_handler, + .next = &action_scan_all_tracks_without_rg }; + +static DB_plugin_action_t action_select_all = { .title = "Edit/Select All", + .name = "select_all", + .flags = DB_ACTION_COMMON, + .callback2 = action_select_all_handler, + .next = &action_deselect_all }; + +static DB_plugin_action_t action_quit = { .title = "Quit", + .name = "quit", + .flags = DB_ACTION_COMMON, + .callback2 = action_quit_handler, + .next = &action_select_all }; + +static DB_plugin_action_t action_delete_from_disk = { .title = "Delete from Disk", + .name = "delete_from_disk", + .flags = DB_ACTION_MULTIPLE_TRACKS, + .callback2 = action_delete_from_disk_handler, + .next = &action_quit }; + +static DB_plugin_action_t action_add_location = { .title = "File/Add Location", + .name = "add_location", + .flags = DB_ACTION_COMMON, + .callback2 = action_add_location_handler, + .next = &action_delete_from_disk }; + +static DB_plugin_action_t action_add_folders = { .title = "File/Add Folder(s)", + .name = "add_folders", + .flags = DB_ACTION_COMMON, + .callback2 = action_add_folders_handler, + .next = &action_add_location }; + +static DB_plugin_action_t action_add_files = { .title = "File/Add File(s)", + .name = "add_files", + .flags = DB_ACTION_COMMON, + .callback2 = action_add_files_handler, + .next = &action_add_folders }; + +static DB_plugin_action_t action_open_files = { .title = "File/Open File(s)", + .name = "open_files", + .flags = DB_ACTION_COMMON, + .callback2 = action_open_files_handler, + .next = &action_add_files }; + +static DB_plugin_action_t action_track_properties = { .title = "Track Properties", + .name = "track_properties", + .flags = DB_ACTION_MULTIPLE_TRACKS, + .callback2 = action_show_track_properties_handler, + .next = &action_open_files }; + +static DB_plugin_action_t action_show_help = { .title = "Help/Show Help Page", + .name = "help", + .flags = DB_ACTION_COMMON, + .callback2 = action_show_help_handler, + .next = &action_track_properties }; + +static DB_plugin_action_t action_playback_loop_cycle = { .title = "Playback/Cycle Repeat Mode", + .name = "loop_cycle", + .flags = DB_ACTION_COMMON, + .callback2 = action_playback_loop_cycle_handler, + .next = &action_show_help }; + +static DB_plugin_action_t action_playback_loop_off = { .title = "Playback/Repeat - Off", + .name = "loop_off", + .flags = DB_ACTION_COMMON, + .callback2 = action_playback_loop_off_handler, + .next = &action_playback_loop_cycle }; + +static DB_plugin_action_t action_playback_loop_single = { .title = "Playback/Repeat - Single Track", + .name = "loop_track", + .flags = DB_ACTION_COMMON, + .callback2 = action_playback_loop_single_handler, + .next = &action_playback_loop_off }; + +static DB_plugin_action_t action_playback_loop_all = { .title = "Playback/Repeat - All", + .name = "loop_all", + .flags = DB_ACTION_COMMON, + .callback2 = action_playback_loop_all_handler, + .next = &action_playback_loop_single }; + +static DB_plugin_action_t action_playback_order_cycle = { .title = "Playback/Cycle Shuffle Mode", + .name = "order_cycle", + .flags = DB_ACTION_COMMON, + .callback2 = action_playback_order_cycle_handler, + .next = &action_playback_loop_all }; + +static DB_plugin_action_t action_playback_order_random = { .title = "Playback/Shuffle - Random Tracks", + .name = "order_random", + .flags = DB_ACTION_COMMON, + .callback2 = action_playback_order_random_handler, + .next = &action_playback_order_cycle }; + +static DB_plugin_action_t action_playback_order_shuffle_albums = { .title = "Playback/Shuffle - Albums", + .name = "order_shuffle_albums", + .flags = DB_ACTION_COMMON, + .callback2 = + action_playback_order_shuffle_albums_handler, + .next = &action_playback_order_random }; + +static DB_plugin_action_t action_playback_order_shuffle = { .title = "Playback/Shuffle - Tracks", + .name = "order_shuffle", + .flags = DB_ACTION_COMMON, + .callback2 = action_playback_order_shuffle_handler, + .next = &action_playback_order_shuffle_albums }; + +static DB_plugin_action_t action_playback_order_linear = { .title = "Playback/Shuffle - Off", + .name = "order_linear", + .flags = DB_ACTION_COMMON, + .callback2 = action_playback_order_linear_handler, + .next = &action_playback_order_shuffle }; + +static DB_plugin_action_t action_cursor_follows_playback = { .title = "Playback/Toggle Cursor Follows Playback", + .name = "toggle_cursor_follows_playback", + .flags = DB_ACTION_COMMON, + .callback2 = action_cursor_follows_playback_handler, + .next = &action_playback_order_linear }; + +static DB_plugin_action_t action_scroll_follows_playback = { .title = "Playback/Toggle Scroll Follows Playback", + .name = "toggle_scroll_follows_playback", + .flags = DB_ACTION_COMMON, + .callback2 = action_scroll_follows_playback_handler, + .next = &action_cursor_follows_playback }; + +static DB_plugin_action_t action_toggle_menu = { .title = "View/Show\\/Hide menu", + .name = "toggle_menu", + .flags = DB_ACTION_COMMON, + .callback2 = action_toggle_menu_handler, + .next = &action_scroll_follows_playback }; + +static DB_plugin_action_t action_toggle_statusbar = { .title = "View/Show\\/Hide statusbar", + .name = "toggle_statusbar", + .flags = DB_ACTION_COMMON, + .callback2 = action_toggle_statusbar_handler, + .next = &action_toggle_menu }; + +static DB_plugin_action_t action_toggle_designmode = { .title = "Edit/Toggle Design Mode", + .name = "toggle_design_mode", + .flags = DB_ACTION_COMMON, + .callback2 = action_toggle_designmode_handler, + .next = &action_toggle_statusbar }; + +static DB_plugin_action_t action_preferences = { .title = "Edit/Preferences", + .name = "preferences", + .flags = DB_ACTION_COMMON, + .callback2 = action_preferences_handler, + .next = &action_toggle_designmode }; + +static DB_plugin_action_t action_sort_custom = { .title = "Edit/Sort Custom", + .name = "sort_custom", + .flags = DB_ACTION_COMMON, + .callback2 = action_sort_custom_handler, + .next = &action_preferences }; + +static DB_plugin_action_t action_crop_selected = { .title = "Edit/Crop Selected", + .name = "crop_selected", + .flags = DB_ACTION_COMMON, + .callback2 = action_crop_selected_handler, + .next = &action_sort_custom }; + +static DB_plugin_action_t action_remove_from_playlist = { .title = "Edit/Remove Track(s) from Playlist", + .name = "remove_from_playlist", + .flags = DB_ACTION_MULTIPLE_TRACKS | + DB_ACTION_EXCLUDE_FROM_CTX_PLAYLIST, + .callback2 = action_remove_from_playlist_handler, + .next = &action_crop_selected }; + +static DB_plugin_action_t action_save_playlist = { .title = "File/Save Playlist", + .name = "save_playlist", + .flags = DB_ACTION_COMMON, + .callback2 = action_save_playlist_handler, + .next = &action_remove_from_playlist }; + +static DB_plugin_action_t action_load_playlist = { .title = "File/Load Playlist", + .name = "load_playlist", + .flags = DB_ACTION_COMMON, + .callback2 = action_load_playlist_handler, + .next = &action_save_playlist }; + +static DB_plugin_action_t action_remove_current_playlist = { .title = "File/Remove Current Playlist", + .name = "remove_current_playlist", + .flags = DB_ACTION_COMMON, + .callback2 = action_remove_current_playlist_handler, + .next = &action_load_playlist }; + +static DB_plugin_action_t action_new_playlist = { .title = "File/New Playlist", + .name = "new_playlist", + .flags = DB_ACTION_COMMON, + .callback2 = action_new_playlist_handler, + .next = &action_remove_current_playlist }; + +static DB_plugin_action_t action_rename_current_playlist = { .title = "File/Rename Current Playlist", + .name = "rename_current_playlist", + .flags = DB_ACTION_COMMON, + .callback2 = action_rename_current_playlist_handler, + .next = &action_new_playlist }; + +static DB_plugin_action_t action_toggle_eq = { .title = "View/Show\\/Hide Equalizer", + .name = "toggle_eq", + .flags = DB_ACTION_COMMON, + .callback2 = action_toggle_eq_handler, + .next = &action_rename_current_playlist }; + +static DB_plugin_action_t action_hide_eq = { .title = "View/Hide Equalizer", + .name = "hide_eq", + .flags = DB_ACTION_COMMON, + .callback2 = action_hide_eq_handler, + .next = &action_toggle_eq }; + +static DB_plugin_action_t action_show_eq = { .title = "View/Show Equalizer", + .name = "show_eq", + .flags = DB_ACTION_COMMON, + .callback2 = action_show_eq_handler, + .next = &action_hide_eq }; + +static DB_plugin_action_t action_toggle_mainwin = { .title = "View/Show\\/Hide Player Window", + .name = "toggle_player_window", + .flags = DB_ACTION_COMMON, + .callback2 = action_toggle_mainwin_handler, + .next = &action_show_eq }; + +static DB_plugin_action_t action_hide_mainwin = { .title = "View/Hide Player Window", + .name = "hide_player_window", + .flags = DB_ACTION_COMMON, + .callback2 = action_hide_mainwin_handler, + .next = &action_toggle_mainwin }; + +static DB_plugin_action_t action_show_mainwin = { .title = "View/Show Player Window", + .name = "show_player_window", + .flags = DB_ACTION_COMMON, + .callback2 = action_show_mainwin_handler, + .next = &action_hide_mainwin }; + +static DB_plugin_action_t action_find = { .title = "Edit/Find", + .name = "find", + .flags = DB_ACTION_COMMON, + .callback2 = action_find_handler, + .next = &action_show_mainwin }; + +static DB_plugin_action_t action_view_log = { .title = "View/Show\\/Hide Log window", + .name = "toggle_log_window", + .flags = DB_ACTION_COMMON, + .callback2 = action_toggle_logwindow_handler, + .next = &action_find }; static DB_plugin_action_t * gtkui_get_actions (DB_playItem_t *it) { @@ -2235,7 +2232,13 @@ static const char settings_dlg[] = #pragma mark - Obsolete cover art API stubs GdkPixbuf * -_get_cover_art_pixbuf (const char *uri, const char *artist, const char *album, int size, void (*callback) (void *user_data), void *user_data) { +_get_cover_art_pixbuf ( + const char *uri, + const char *artist, + const char *album, + int size, + void (*callback) (void *user_data), + void *user_data) { return NULL; } @@ -2245,12 +2248,24 @@ _cover_get_default_pixbuf (void) { } static GdkPixbuf * -_get_cover_art_primary (const char *uri, const char *artist, const char *album, int size, void (*callback) (void *user_data), void *user_data) { +_get_cover_art_primary ( + const char *uri, + const char *artist, + const char *album, + int size, + void (*callback) (void *user_data), + void *user_data) { return NULL; } GdkPixbuf * -_get_cover_art_thumb (const char *uri, const char *artist, const char *album, int size, void (*callback) (void *user_data), void *user_data) { +_get_cover_art_thumb ( + const char *uri, + const char *artist, + const char *album, + int size, + void (*callback) (void *user_data), + void *user_data) { return NULL; } @@ -2272,44 +2287,43 @@ ddb_gtkui_t plugin = { .gui.plugin.name = "GTK2 user interface", .gui.plugin.descr = "User interface using GTK+ 2.x", #endif - .gui.plugin.copyright = - "GTK+ user interface for DeaDBeeF Player.\n" - "Copyright (C) 2009-2015 Oleksiy Yakovenko and other contributors\n" - "\n" - "This software is provided 'as-is', without any express or implied\n" - "warranty. In no event will the authors be held liable for any damages\n" - "arising from the use of this software.\n" - "\n" - "Permission is granted to anyone to use this software for any purpose,\n" - "including commercial applications, and to alter it and redistribute it\n" - "freely, subject to the following restrictions:\n" - "\n" - "1. The origin of this software must not be misrepresented; you must not\n" - " claim that you wrote the original software. If you use this software\n" - " in a product, an acknowledgment in the product documentation would be\n" - " appreciated but is not required.\n" - "\n" - "2. Altered source versions must be plainly marked as such, and must not be\n" - " misrepresented as being the original software.\n" - "\n" - "3. This notice may not be removed or altered from any source distribution.\n" - "\n" - "\n" - "GTK - The GIMP Toolkit\n" - "Copyright (C) GTK Developers\n" - "\n" - "This library is free software; you can redistribute it and/or\n" - "modify it under the terms of the GNU Lesser General Public\n" - "License as published by the Free Software Foundation; either\n" - "version 2 of the License, or (at your option) any later version.\n" - "\n" - "This library is distributed in the hope that it will be useful,\n" - "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" - "Lesser General Public License for more details.\n" - "\n" - "You should have received a copy of the GNU Lesser General Public\n" - "License along with this library. If not, see .\n", + .gui.plugin.copyright = "GTK+ user interface for DeaDBeeF Player.\n" + "Copyright (C) 2009-2015 Oleksiy Yakovenko and other contributors\n" + "\n" + "This software is provided 'as-is', without any express or implied\n" + "warranty. In no event will the authors be held liable for any damages\n" + "arising from the use of this software.\n" + "\n" + "Permission is granted to anyone to use this software for any purpose,\n" + "including commercial applications, and to alter it and redistribute it\n" + "freely, subject to the following restrictions:\n" + "\n" + "1. The origin of this software must not be misrepresented; you must not\n" + " claim that you wrote the original software. If you use this software\n" + " in a product, an acknowledgment in the product documentation would be\n" + " appreciated but is not required.\n" + "\n" + "2. Altered source versions must be plainly marked as such, and must not be\n" + " misrepresented as being the original software.\n" + "\n" + "3. This notice may not be removed or altered from any source distribution.\n" + "\n" + "\n" + "GTK - The GIMP Toolkit\n" + "Copyright (C) GTK Developers\n" + "\n" + "This library is free software; you can redistribute it and/or\n" + "modify it under the terms of the GNU Lesser General Public\n" + "License as published by the Free Software Foundation; either\n" + "version 2 of the License, or (at your option) any later version.\n" + "\n" + "This library is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" + "Lesser General Public License for more details.\n" + "\n" + "You should have received a copy of the GNU Lesser General Public\n" + "License along with this library. If not, see .\n", .gui.plugin.website = "http://deadbeef.sf.net", .gui.plugin.start = gtkui_start, .gui.plugin.stop = gtkui_stop,