Discman
Loading...
Searching...
No Matches
album_art_component.h
Go to the documentation of this file.
1
6
7#ifndef ALBUM_ART_COMPONENT
8#define ALBUM_ART_COMPONENT
9
10#include <string>
11#include <cmath>
12
13#include <glibmm.h>
14#include <gtkmm/builder.h>
15#include <gtkmm/button.h>
16#include <gtkmm/grid.h>
17#include <gtkmm/viewport.h>
18#include <gtkmm/image.h>
19#include <sigc++/signal.h>
20
22#include "component.h"
23
26
27 public:
28
30 typedef sigc::signal<void()> sig_done;
31
33 typedef sigc::signal<void(const std::string)> sig_art;
34
36 static constexpr int ART_SIZE = 128;
37
40 AlbumArtComponent(Glib::RefPtr<Gtk::Builder> builder);
41
44
47
52 void set_album_arts(const std::vector<AlbumArtProvider::AlbumArt>& arts, const int window_width);
53
54 private:
56 static constexpr int SPACING = 16;
57
60
61 Gtk::Button* _done_button;
62 Gtk::Viewport* _viewport;
63 Gtk::Grid* _grid;
64
67};
68
69
70#endif // ALBUM_ART_COMPONENT
Gtk::Button * _done_button
Done button on the art selection screen.
Gtk::Viewport * _viewport
Viewport that displays the grid of album art.
AlbumArtComponent(Glib::RefPtr< Gtk::Builder > builder)
AlbumArtComponent constructor.
~AlbumArtComponent()
AlbumArtComponent destructior.
void on_done_button_clicked()
Called when the "done" button is clicked.
sig_done _signal_done
Emitted when the user leaves the art selection screen.
sigc::signal< void(const std::string)> sig_art
"Art selected" signal type.
static constexpr int SPACING
The spacing between images.
static constexpr int ART_SIZE
The width and height of art displayed on the album art selection screen.
void set_album_arts(const std::vector< AlbumArtProvider::AlbumArt > &arts, const int window_width)
Set the album art images to show on the selection screen.
Gtk::Grid * _grid
Grid of album art.
sig_done signal_done()
Getter for _signal_done.
sig_art signal_art()
Getter for _signal_art.
sigc::signal< void()> sig_done
"Done with screen" signal type.
sig_art _signal_art
Emitted when the user selects an album art image.