- commit
- 26ecaa375984e2837eb67a171940a53a58ebe899
- parent
- a90f732b9db8364bf852308fe020cbb1b714d4de
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2010-11-02 23:53
sdl_mixer
Diffstat
| M | README | 1 | + |
| D | expermients/gs.c | 58 | ---------------------------------------------------------- |
| M | src/gui/xiRTMainFrame.cpp | 12 | ++++++++++-- |
| M | src/gui/xiRTMainFrame.h | 7 | +++++-- |
| M | src/gui/xiRetimer_wxfb.cpp | 2 | +- |
| M | src/make | 2 | +- |
| M | xiRetimer | 0 |
7 files changed, 18 insertions, 64 deletions
diff --git a/README b/README
@@ -16,3 +16,4 @@ exits with error 16 16 improve AudioShape 17 17 bugtracking 18 18 libmad -1 19 soundtouch
diff --git a/expermients/gs.c b/expermients/gs.c
@@ -1,58 +0,0 @@1 -1 #include <gst/gst.h>2 -1 #include <stdbool.h>3 -14 -1 static GMainLoop *loop;5 -16 -1 static gboolean bus_call(GstBus *bus, GstMessage *msg, void *user_data)7 -1 {8 -1 switch (GST_MESSAGE_TYPE(msg)) {9 -1 case GST_MESSAGE_EOS: {10 -1 g_message("End-of-stream");11 -1 g_main_loop_quit(loop);12 -1 break;13 -1 }14 -1 case GST_MESSAGE_ERROR: {15 -1 GError *err;16 -1 gst_message_parse_error(msg, &err, NULL);17 -1 g_error("%s", err->message);18 -1 g_error_free(err);19 -120 -1 g_main_loop_quit(loop);21 -1 break;22 -1 }23 -1 default:24 -1 break;25 -1 }26 -127 -1 return true;28 -1 }29 -130 -1 static void play_uri(const char *uri)31 -1 {32 -1 GstElement *pipeline;33 -1 GstBus *bus;34 -135 -1 loop = g_main_loop_new(NULL, FALSE);36 -1 pipeline = gst_element_factory_make("playbin", "player");37 -138 -1 if (uri)39 -1 g_object_set(G_OBJECT(pipeline), "uri", uri, NULL);40 -141 -1 bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));42 -1 gst_bus_add_watch(bus, bus_call, NULL);43 -1 gst_object_unref(bus);44 -145 -1 gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);46 -147 -1 g_main_loop_run(loop);48 -149 -1 gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_NULL);50 -1 gst_object_unref(GST_OBJECT(pipeline));51 -1 }52 -153 -1 int main(int argc, char *argv[])54 -1 {55 -1 gst_init(&argc, &argv);56 -1 play_uri(argv[1]);57 -1 return 0;58 -1 }
diff --git a/src/gui/xiRTMainFrame.cpp b/src/gui/xiRTMainFrame.cpp
@@ -13,11 +13,12 @@ 13 13 xiRTMainFrame::xiRTMainFrame( wxWindow* parent ) : MainFrame( parent ) { 14 14 curve=new Curve(); 15 15 sample=curve->sample;16 -1 curve->setSeeker(0);-1 16 playback=new Playback(sample); 17 17 width=100; // anything greater than 2 18 18 height=100; 19 19 Marker_move=false; 20 20 Seeker_move=false; -1 21 _play=false; 21 22 } 22 23 23 24 xiRTMainFrame::~xiRTMainFrame() {} @@ -99,7 +100,14 @@ void xiRTMainFrame::OnStartClick( wxCommandEvent& event ) { 99 100 } 100 101 101 102 void xiRTMainFrame::OnPlayClick( wxCommandEvent& event ) {102 -1 // TODO implement playback-1 103 if (_play) { -1 104 playback->stop(); -1 105 _play=false; -1 106 } -1 107 else { -1 108 if (playback->start()==0) -1 109 _play=true; -1 110 } 103 111 } 104 112 105 113 void xiRTMainFrame::OnEndClick( wxCommandEvent& event ) {
diff --git a/src/gui/xiRTMainFrame.h b/src/gui/xiRTMainFrame.h
@@ -9,6 +9,7 @@ Subclass of MainFrame, which is generated by wxFormBuilder. 9 9 #include "xiRetimer_wxfb.h" 10 10 #include "../sample.h" 11 11 #include "../curve.h" -1 12 #include "../playback.h" 12 13 13 14 14 15 /** Implementing MainFrame */ @@ -41,12 +42,14 @@ protected: 41 42 static const int MARKERWIDTH=15; 42 43 static const int BEAT=15; 43 4444 -1 Sample* sample;45 -1 Curve* curve;-1 45 Sample *sample; -1 46 Curve *curve; -1 47 Playback *playback; 46 48 int width; 47 49 int height; 48 50 bool Marker_move; 49 51 bool Seeker_move; -1 52 bool _play; 50 53 51 54 public: 52 55 /** Constructor */
diff --git a/src/gui/xiRetimer_wxfb.cpp b/src/gui/xiRetimer_wxfb.cpp
@@ -64,7 +64,7 @@ wxInitAllImageHandlers(); 64 64 65 65 m_edit = new wxMenu(); 66 66 wxMenuItem* m_play;67 -1 m_play = new wxMenuItem( m_edit, wxID_ANY, wxString( wxT("play/pause") ) + wxT('\t') + wxT("SPACE"), wxEmptyString, wxITEM_CHECK );-1 67 m_play = new wxMenuItem( m_edit, wxID_ANY, wxString( wxT("play/pause") ) + wxT('\t') + wxT("SPACE"), wxEmptyString, wxITEM_NORMAL ); 68 68 #ifdef __WXMSW__ 69 69 #elif defined( __WXGTK__ ) 70 70 m_play->SetBitmap( wxBitmap( wxT("/usr/share/icons/gnome/16x16/actions/media-playback-start.png"), wxBITMAP_TYPE_ANY ) );
diff --git a/src/make b/src/make
@@ -1,3 +1,3 @@1 -1 g++ *.h *.cpp gui/*.h gui/*.cpp `wx-config --cxxflags --libs` `pkg-config --cflags --libs rubberband sndfile` -o ../xiRetimer-1 1 g++ *.h *.cpp gui/*.h gui/*.cpp `wx-config --cxxflags --libs` `sdl-config --cflags --libs` -lSDL_mixer `pkg-config --cflags --libs rubberband sndfile` -o ../xiRetimer 2 2 rm *.gch 3 3 rm gui/*.gch