gui: Move toggle function to gst code

This lets me remove the controls.cpp and controls.h files.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-01-14 19:35:02 -05:00
parent 434b278b61
commit ed88bb08bd
6 changed files with 13 additions and 30 deletions

View File

@ -1,14 +0,0 @@
/*
* Copyright 2014 (c) Anna Schumaker.
*/
#include <lib/lib.h>
#include <core/audio.h>
#include <gui/ocarina.h>
void o_toggle()
{
if (audio :: get_driver()->is_playing())
audio :: pause();
else
audio :: play();
}

View File

@ -161,6 +161,14 @@ static bool on_timeout()
return true;
}
void on_toggle()
{
if (gst_driver->is_playing())
audio :: pause();
else
audio :: play();
}
void init_gst(int *argc, char ***argv)
{

View File

@ -8,7 +8,6 @@
#include <lib/colmgr.h>
#include <lib/lib.h>
#include <gui/controls.h>
#include <gui/ocarina.h>
#include <gui/tabs.h>

View File

@ -4,7 +4,6 @@
#include <core/audio.h>
#include <core/deck.h>
#include <core/version.h>
#include <gui/controls.h>
#include <gui/ocarina.h>
#include <gui/tabs.h>
@ -50,10 +49,10 @@ static bool on_window_key_released(GdkEventKey *event)
{
std::string key = gdk_keyval_name(event->keyval);
if (key == "space")
o_toggle();
else
if (key != "space")
return false;
on_toggle();
return true;
}

View File

@ -1,11 +0,0 @@
/*
* Copyright 2014 (c) Anna Schumaker.
*/
#ifndef OCARINA_GUI_CONTROLS_H
#define OCARINA_GUI_CONTROLS_H
void o_toggle();
void on_next();
#endif /* OCARINA_GUI_CONTROLS_H */

View File

@ -27,6 +27,8 @@ void post_init_queue_tabs();
/* gst.cpp */
void on_next();
void on_toggle();
void init_gst(int *, char ***);
void quit_gst();