Debian Codegraph @

examples/media_player_gtkmm/player_window.h

raw symbols SCIP
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2015 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 PLAYER_WINDOW_H_
20 #define PLAYER_WINDOW_H_
21
22 #include <gtkmm.h>
23 #include <gstreamermm.h>
24
25 class PlayerWindow : public Gtk::Window
26 {
27 public:
28 #ifndef GSTREAMERMM_DISABLE_DEPRECATED
29 using PlayBinT = Gst::PlayBin;
30 #else
31 using PlayBinT = Gst::Element;
32 #endif
33 PlayerWindow(const Glib::RefPtr<PlayBinT>& playbin);
34 virtual ~PlayerWindow();
35
36 protected:
37
38 //Signal handlers:
39 void on_video_area_realize();
40 void on_bus_message_sync(const Glib::RefPtr<Gst::Message>& message);
41 bool on_bus_message(const Glib::RefPtr<Gst::Bus>& bus, const Glib::RefPtr<Gst::Message>& message);
42 void on_video_changed();
43 Gst::PadProbeReturn on_video_pad_got_buffer(const Glib::RefPtr<Gst::Pad>& pad, const Gst::PadProbeInfo& data);
44
45 void on_button_play();
46 void on_button_pause();
47 void on_button_stop();
48 void on_button_rewind();
49 void on_button_forward();
50 void on_button_open();
51 bool on_scale_value_changed(Gtk::ScrollType type, double value);
52 bool on_timeout();
53
54 void display_label_progress(gint64 pos, gint64 len);
55
56 protected:
57 Gtk::VBox m_vbox;
58 Gtk::HButtonBox m_button_box;
59 Gtk::DrawingArea m_video_area;
60 Gtk::Label m_progress_label;
61 Gtk::HScale m_progress_scale;
62 Gtk::Button m_play_button;
63 Gtk::Button m_pause_button;
64 Gtk::Button m_stop_button;
65 Gtk::Button m_rewind_button;
66 Gtk::Button m_forward_button;
67 Gtk::Button m_open_button;
68
69 #ifndef GSTREAMERMM_DISABLE_DEPRECATED
70 Glib::RefPtr<Gst::PlayBin> m_playbin;
71 #else
72 Glib::RefPtr<Gst::Element> m_playbin;
73 #endif
74
75 sigc::connection m_timeout_connection;
76 guint m_watch_id;
77 gint64 m_duration;
78 gulong window_handler;
79 gulong m_pad_probe_id;
80
81 const gint64 rewind_skip_amount = Gst::SECOND * 2;
82 const gint64 forward_skip_amount = Gst::SECOND * 3;
83 };
84
85 #endif /* PLAYER_WINDOW_H_ */