Debian Codegraph @

examples/ogg_player_gtkmm/player_window.h

raw symbols SCIP
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2008 The gstreamermm Development Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 #ifndef _PLAYERWINDOW_H
20 #define _PLAYERWINDOW_H
21
22 #include <gtkmm/window.h>
23 #include <gtkmm/box.h>
24 #include <gtkmm/buttonbox.h>
25 #include <gtkmm/label.h>
26 #include <gtkmm/button.h>
27 #include <gtkmm/scale.h>
28 #include <gstreamermmconfig.h>
29 #include <gstreamermm/element.h>
30 #include <gstreamermm/pipeline.h>
31 #include <gstreamermm/filesrc.h>
32
33 class PlayerWindow : public Gtk::Window
34 {
35 public:
36 #ifndef GSTREAMERMM_DISABLE_DEPRECATED
37 using FileSrcT = Gst::FileSrc;
38 #else
39 using FileSrcT = Gst::Element;
40 #endif
41 PlayerWindow(const Glib::RefPtr<FileSrcT>& sourceElement,
42 const Glib::RefPtr<Gst::Pipeline>& mainPipeline);
43
44 virtual ~PlayerWindow();
45
46 protected:
47
48 //Signal handlers:
49 bool on_bus_message(const Glib::RefPtr<Gst::Bus>& bus,
50 const Glib::RefPtr<Gst::Message>& message);
51
52 void on_button_play();
53 void on_button_pause();
54 void on_button_stop();
55 bool on_scale_value_changed(Gtk::ScrollType type, double value);
56 void on_button_rewind();
57 void on_button_forward();
58 void on_button_open();
59
60 bool on_timeout();
61 void display_label_progress(gint64 pos, gint64 len);
62
63 Gtk::VBox m_vbox;
64 Gtk::HButtonBox m_button_box;
65 Gtk::Label m_progress_label;
66 Gtk::HScale m_progress_scale;
67 Gtk::Button m_play_button;
68 Gtk::Button m_pause_button;
69 Gtk::Button m_stop_button;
70 Gtk::Button m_rewind_button;
71 Gtk::Button m_forward_button;
72 Gtk::Button m_open_button;
73
74 Glib::RefPtr<FileSrcT> m_source_element;
75 Glib::RefPtr<Gst::Pipeline> m_main_pipeline;
76 sigc::connection m_progress_connection;
77 unsigned int m_watch_id;
78 gint64 m_duration;
79 };
80
81 #endif /* _PLAYERWINDOW_H */