|
Discman
|
Handles the interactions with the "now playing" side of the main screen. More...
#include <now_playing_component.h>


Public Types | |
| enum | State { Disabled , Cleared , Playing , Paused , Stopped } |
| The component has several states it can be put into. More... | |
| enum | Button { Previous , PlayPause , Stop , Next } |
| Playback control button identifiers. More... | |
| typedef sigc::signal< void(const Button)> | sig_button |
| "Playback button clicked" signal type. | |
| typedef sigc::signal< void(void)> | sig_album_art |
| "Album art clicked" signal type. | |
Public Member Functions | |
| NowPlayingComponent (Glib::RefPtr< Gtk::Builder > builder) | |
| NowPlayingComponent constructor. | |
| ~NowPlayingComponent () | |
| NowPlayingComponent destructor. | |
| void | set_track (const DiscDB::Disc &disc, unsigned int track, const bool first, const bool last) |
| Sets the information for the track currently playing. | |
| void | set_state (const State state) |
| Sets the state of the component. | |
| State | get_state () const |
| Returns the state of the component. | |
| void | set_seconds (const float seconds) |
| Sets the elapsed seconds. | |
| void | set_album (const std::string &url) |
| Sets the album art image. | |
| sig_button | signal_button () |
| Getter for _signal_button. | |
| sig_album_art | signal_album_art () |
| Getter for _signal_album_art. | |
Private Member Functions | |
| void | on_prev_button_clicked () |
| Called when the previous track button is clicked. | |
| void | on_playpause_button_clicked () |
| Called when the play/pause button is clicked. | |
| void | on_stop_button_clicked () |
| Called when the stop button is clicked. | |
| void | on_next_button_clicked () |
| Called when the next track button is clicked. | |
| void | on_album_art_button_clicked () |
| Called when the album art button is clicked. | |
Private Attributes | |
| State | _state |
| State of the component. | |
| Gtk::Button * | _album_art_button |
| Button that shows the album art. | |
| Gtk::Image * | _album_art_image |
| Album art image. | |
| Gtk::Label * | _track_title_label |
| Track title label. | |
| Gtk::Label * | _track_artist_label |
| Track artist label. | |
| Gtk::Scale * | _seek_scale |
| Display for elapsed time. | |
| Gtk::Button * | _prev_button |
| Previous track button. | |
| Gtk::Button * | _play_pause_button |
| Play/pause button. | |
| Gtk::Button * | _stop_button |
| Stop button. | |
| Gtk::Button * | _next_button |
| Next track button. | |
| Gtk::Image * | _play_pause_image |
| The current image displayed on the play/pause button. It will either be a "play" icon or a "pause" icon. | |
| sig_button | _signal_button |
| Emitted when a playback control button is clicked. | |
| sig_album_art | _signal_album_art |
| Emitted when the album art button is clicked. | |
Additional Inherited Members | |
Protected Member Functions inherited from Component | |
| Component () | |
| virtual | ~Component ()=0 |
Handles the interactions with the "now playing" side of the main screen.
Definition at line 26 of file now_playing_component.h.
| typedef sigc::signal<void(void)> NowPlayingComponent::sig_album_art |
"Album art clicked" signal type.
Definition at line 51 of file now_playing_component.h.
| typedef sigc::signal<void(const Button)> NowPlayingComponent::sig_button |
"Playback button clicked" signal type.
Definition at line 48 of file now_playing_component.h.
Playback control button identifiers.
| Enumerator | |
|---|---|
| Previous | |
| PlayPause | |
| Stop | |
| Next | |
Definition at line 40 of file now_playing_component.h.
The component has several states it can be put into.
| Enumerator | |
|---|---|
| Disabled | |
| Cleared | |
| Playing | |
| Paused | |
| Stopped | |
Definition at line 31 of file now_playing_component.h.
| NowPlayingComponent::NowPlayingComponent | ( | Glib::RefPtr< Gtk::Builder > | builder | ) |
NowPlayingComponent constructor.
| [in] | builder | The builder initialized with the widgets managed by this component. |
Definition at line 9 of file now_playing_component.cc.
| NowPlayingComponent::~NowPlayingComponent | ( | ) |
NowPlayingComponent destructor.
Definition at line 33 of file now_playing_component.cc.
| NowPlayingComponent::State NowPlayingComponent::get_state | ( | ) | const |
Returns the state of the component.
Definition at line 73 of file now_playing_component.cc.
|
private |
Called when the album art button is clicked.
Definition at line 114 of file now_playing_component.cc.
|
private |
Called when the next track button is clicked.
Definition at line 110 of file now_playing_component.cc.
|
private |
Called when the play/pause button is clicked.
Definition at line 102 of file now_playing_component.cc.
|
private |
Called when the previous track button is clicked.
Definition at line 98 of file now_playing_component.cc.
|
private |
Called when the stop button is clicked.
Definition at line 106 of file now_playing_component.cc.
| void NowPlayingComponent::set_album | ( | const std::string & | url | ) |
Sets the album art image.
| [in] | url | The URL of the album art image. |
Definition at line 81 of file now_playing_component.cc.
| void NowPlayingComponent::set_seconds | ( | const float | seconds | ) |
Sets the elapsed seconds.
| [in] | seconds | Fractional elapsed seconds . |
Definition at line 77 of file now_playing_component.cc.
| void NowPlayingComponent::set_state | ( | const State | state | ) |
Sets the state of the component.
| [in] | state | The new state to enter. |
Definition at line 55 of file now_playing_component.cc.
| void NowPlayingComponent::set_track | ( | const DiscDB::Disc & | disc, |
| unsigned int | track, | ||
| const bool | first, | ||
| const bool | last ) |
Sets the information for the track currently playing.
| disc | All of the album information. |
| track | 1-based index of the track. |
| first | Whether the track is the first on the disc. |
| last | Whether the track is the last on the disc. |
Definition at line 45 of file now_playing_component.cc.
| NowPlayingComponent::sig_album_art NowPlayingComponent::signal_album_art | ( | ) |
Getter for _signal_album_art.
Definition at line 94 of file now_playing_component.cc.
| NowPlayingComponent::sig_button NowPlayingComponent::signal_button | ( | ) |
Getter for _signal_button.
Definition at line 90 of file now_playing_component.cc.
|
private |
Button that shows the album art.
Definition at line 89 of file now_playing_component.h.
|
private |
Album art image.
Definition at line 90 of file now_playing_component.h.
|
private |
Next track button.
Definition at line 97 of file now_playing_component.h.
|
private |
Play/pause button.
Definition at line 95 of file now_playing_component.h.
|
private |
The current image displayed on the play/pause button. It will either be a "play" icon or a "pause" icon.
Definition at line 101 of file now_playing_component.h.
|
private |
Previous track button.
Definition at line 94 of file now_playing_component.h.
|
private |
Display for elapsed time.
Definition at line 93 of file now_playing_component.h.
|
private |
Emitted when the album art button is clicked.
Definition at line 104 of file now_playing_component.h.
|
private |
Emitted when a playback control button is clicked.
Definition at line 103 of file now_playing_component.h.
|
private |
State of the component.
Definition at line 87 of file now_playing_component.h.
|
private |
Stop button.
Definition at line 96 of file now_playing_component.h.
|
private |
Track artist label.
Definition at line 92 of file now_playing_component.h.
|
private |
Track title label.
Definition at line 91 of file now_playing_component.h.