Discman
Loading...
Searching...
No Matches
now_playing_component.h
Go to the documentation of this file.
1
6
7#ifndef NOW_PLAYING_COMPONENT
8#define NOW_PLAYING_COMPONENT
9
10#include <glibmm.h>
11#include <gtkmm/builder.h>
12#include <gtkmm/image.h>
13#include <gtkmm/label.h>
14#include <gtkmm/scale.h>
15#include <gtkmm/adjustment.h>
16#include <gtkmm/button.h>
17#include <gdkmm/pixbuf.h>
18#include <sigc++/signal.h>
19
20#include <discdb/disc.h>
21
23#include "component.h"
24
27
28 public:
29
38
46
48 typedef sigc::signal<void(const Button)> sig_button;
49
51 typedef sigc::signal<void(void)> sig_album_art;
52
55 NowPlayingComponent(Glib::RefPtr<Gtk::Builder> builder);
56
59
65 void set_track(const DiscDB::Disc& disc, unsigned int track, const bool first, const bool last);
66
69 void set_state(const State state);
70
73 State get_state() const;
74
77 void set_seconds(const float seconds);
78
81 void set_album(const std::string& url);
82
85
86 private:
88
89 Gtk::Button* _album_art_button;
90 Gtk::Image* _album_art_image;
91 Gtk::Label* _track_title_label;
92 Gtk::Label* _track_artist_label;
93 Gtk::Scale* _seek_scale;
94 Gtk::Button* _prev_button;
95 Gtk::Button* _play_pause_button;
96 Gtk::Button* _stop_button;
97 Gtk::Button* _next_button;
98
101 Gtk::Image* _play_pause_image;
102
105
111};
112
113#endif // NOW_PLAYING_COMPONENT
void set_state(const State state)
Sets the state of the component.
sigc::signal< void(const Button)> sig_button
"Playback button clicked" signal type.
sig_album_art signal_album_art()
Getter for _signal_album_art.
NowPlayingComponent(Glib::RefPtr< Gtk::Builder > builder)
NowPlayingComponent constructor.
Gtk::Image * _play_pause_image
The current image displayed on the play/pause button. It will either be a "play" icon or a "pause" ic...
Gtk::Scale * _seek_scale
Display for elapsed time.
Gtk::Button * _album_art_button
Button that shows the album art.
~NowPlayingComponent()
NowPlayingComponent destructor.
Gtk::Image * _album_art_image
Album art image.
sig_album_art _signal_album_art
Emitted when the album art button is clicked.
void on_playpause_button_clicked()
Called when the play/pause button is clicked.
sigc::signal< void(void)> sig_album_art
"Album art clicked" signal type.
Button
Playback control button identifiers.
void on_prev_button_clicked()
Called when the previous track button is clicked.
Gtk::Button * _stop_button
Stop button.
void set_seconds(const float seconds)
Sets the elapsed seconds.
void set_track(const DiscDB::Disc &disc, unsigned int track, const bool first, const bool last)
Sets the information for the track currently playing.
Gtk::Label * _track_title_label
Track title label.
void on_album_art_button_clicked()
Called when the album art button is clicked.
Gtk::Button * _next_button
Next track button.
State get_state() const
Returns the state of the component.
Gtk::Button * _prev_button
Previous track button.
void on_stop_button_clicked()
Called when the stop button is clicked.
sig_button _signal_button
Emitted when a playback control button is clicked.
void set_album(const std::string &url)
Sets the album art image.
void on_next_button_clicked()
Called when the next track button is clicked.
Gtk::Button * _play_pause_button
Play/pause button.
State
The component has several states it can be put into.
State _state
State of the component.
Gtk::Label * _track_artist_label
Track artist label.
sig_button signal_button()
Getter for _signal_button.