Skip to content

Commit

Permalink
removed some unnecessary functions from plugin API
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksiy-Yakovenko committed Dec 31, 2010
1 parent e06308f commit 1dec3a1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 81 deletions.
6 changes: 0 additions & 6 deletions deadbeef.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,6 @@ typedef struct {
void (*md5_finish)(DB_md5_t *s, uint8_t digest[16]);
// playback control
struct DB_output_s* (*get_output) (void);
void (*playback_next) (void);
void (*playback_prev) (void);
void (*playback_pause) (void);
void (*playback_stop) (void);
void (*playback_play) (void);
void (*playback_random) (void);
float (*playback_get_pos) (void); // [0..100]
void (*playback_set_pos) (float pos); // [0..100]
// streamer access
Expand Down
44 changes: 0 additions & 44 deletions plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ static DB_functions_t deadbeef_api = {
.md5_append = (void (*)(DB_md5_t *s, const uint8_t *daya, int nbytes))md5_append,
.md5_finish = (void (*)(DB_md5_t *s, uint8_t digest[16]))md5_finish,
.get_output = plug_get_output,
.playback_next = plug_playback_next,
.playback_prev = plug_playback_prev,
.playback_pause = plug_playback_pause,
.playback_stop = plug_playback_stop,
.playback_play = plug_playback_play,
.playback_random = plug_playback_random,
.playback_get_pos = plug_playback_get_pos,
.playback_set_pos = plug_playback_set_pos,
// streamer access
Expand All @@ -96,8 +90,6 @@ static DB_functions_t deadbeef_api = {
.get_doc_dir = plug_get_doc_dir,
.get_plugin_dir = plug_get_plugin_dir,
.get_pixmap_dir = plug_get_pixmap_dir,
// process control
.quit = plug_quit,
// threading
.thread_start = thread_start,
.thread_start_low_priority = thread_start_low_priority,
Expand Down Expand Up @@ -402,36 +394,6 @@ plug_ev_unsubscribe (DB_plugin_t *plugin, int ev, DB_callback_t callback, uintpt
mutex_unlock (mutex);
}

void
plug_playback_next (void) {
messagepump_push (M_NEXT, 0, 0, 0);
}

void
plug_playback_prev (void) {
messagepump_push (M_PREV, 0, 0, 0);
}

void
plug_playback_pause (void) {
messagepump_push (M_TOGGLE_PAUSE, 0, 0, 0);
}

void
plug_playback_stop (void) {
messagepump_push (M_STOP, 0, 0, 0);
}

void
plug_playback_play (void) {
messagepump_push (M_PLAY_CURRENT, 0, 0, 0);
}

void
plug_playback_random (void) {
messagepump_push (M_PLAY_RANDOM, 0, 0, 0);
}

float
plug_playback_get_pos (void) {
playItem_t *trk = streamer_get_playing_track ();
Expand Down Expand Up @@ -463,12 +425,6 @@ plug_playback_set_pos (float pos) {
streamer_set_seek (t);
}

void
plug_quit (void) {
// FIXME progress_abort ();
messagepump_push (M_TERMINATE, 0, 0, 0);
}

/////// non-api functions (plugin support)
void
plug_event_call (DB_event_t *ev) {
Expand Down
21 changes: 0 additions & 21 deletions plugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,6 @@ plug_md5 (uint8_t sig[16], const char *in, int len);
void
plug_md5_to_str (char *str, const uint8_t sig[16]);

void
plug_playback_next (void);

void
plug_playback_prev (void);

void
plug_playback_pause (void);

void
plug_playback_stop (void);

void
plug_playback_play (void);

void
plug_playback_random (void);

void
plug_quit (void);

float
plug_playback_get_pos (void);

Expand Down
4 changes: 2 additions & 2 deletions plugins/converter/convgui.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ on_converter_output_browse_clicked (GtkButton *button,
if (folder) {
deadbeef->conf_set_str ("filechooser.lastdir", folder);
g_free (folder);
deadbeef->sendmessage (M_CONFIGCHANGED, 0, 0, 0);
deadbeef->sendmessage (M_CONFIG_CHANGED, 0, 0, 0);
}
if (response == GTK_RESPONSE_OK) {
folder = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dlg));
Expand Down Expand Up @@ -737,7 +737,7 @@ on_dsp_preset_plugin_configure_clicked (GtkButton *button,
.set_param = dsp_ctx_set_param,
.get_param = dsp_ctx_get_param,
};
gtkui_plugin->gui.run_dialog (&conf, 0);
gtkui_plugin->gui.run_dialog (&conf, 0, NULL, NULL);
current_dsp_context = NULL;
}

Expand Down
16 changes: 8 additions & 8 deletions plugins/hotkeys/hotkeys.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,49 +508,49 @@ hotkeys_reset (void) {

int
action_play_cb (struct DB_plugin_action_s *action, DB_playItem_t *it) {
deadbeef->playback_play ();
deadbeef->sendmessage (M_PLAY_CURRENT, 0, 0, 0);
return 0;
}

int
action_prev_cb (struct DB_plugin_action_s *action, DB_playItem_t *it) {
deadbeef->playback_prev ();
deadbeef->sendmessage (M_PREV, 0, 0, 0);
return 0;
}

int
action_next_cb (struct DB_plugin_action_s *action, DB_playItem_t *it) {
deadbeef->playback_next ();
deadbeef->sendmessage (M_NEXT, 0, 0, 0);
return 0;
}

int
action_stop_cb (struct DB_plugin_action_s *action, DB_playItem_t *it) {
deadbeef->playback_stop ();
deadbeef->sendmessage (M_STOP, 0, 0, 0);
return 0;
}

int
action_toggle_pause_cb (struct DB_plugin_action_s *action, DB_playItem_t *it) {
deadbeef->playback_pause ();
deadbeef->sendmessage (M_TOGGLE_PAUSE, 0, 0, 0);
return 0;
}

int
action_play_pause_cb (struct DB_plugin_action_s *action, DB_playItem_t *it) {
int state = deadbeef->get_output ()->state ();
if (state == OUTPUT_STATE_PLAYING) {
deadbeef->playback_pause ();
deadbeef->sendmessage (M_PAUSE, 0, 0, 0);
}
else {
deadbeef->playback_play ();
deadbeef->sendmessage (M_PLAY_CURRENT, 0, 0, 0);
}
return 0;
}

int
action_play_random_cb (struct DB_plugin_action_s *action, DB_playItem_t *it) {
deadbeef->playback_random ();
deadbeef->sendmessage (M_PLAY_RANDOM, 0, 0, 0);
return 0;
}

Expand Down

0 comments on commit 1dec3a1

Please sign in to comment.