Discman
Loading...
Searching...
No Matches
AlbumArtComponent Class Reference

Handles the interactions with the album art selection screen. More...

#include <album_art_component.h>

Inheritance diagram for AlbumArtComponent:
Collaboration diagram for AlbumArtComponent:

Public Types

typedef sigc::signal< void()> sig_done
 "Done with screen" signal type.
 
typedef sigc::signal< void(const std::string)> sig_art
 "Art selected" signal type.
 

Public Member Functions

 AlbumArtComponent (Glib::RefPtr< Gtk::Builder > builder)
 AlbumArtComponent constructor.
 
 ~AlbumArtComponent ()
 AlbumArtComponent destructior.
 
sig_done signal_done ()
 Getter for _signal_done.
 
sig_art signal_art ()
 Getter for _signal_art.
 
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.
 

Static Public Attributes

static constexpr int ART_SIZE = 128
 The width and height of art displayed on the album art selection screen.
 

Private Member Functions

void on_done_button_clicked ()
 Called when the "done" button is clicked.
 

Private Attributes

sig_done _signal_done
 Emitted when the user leaves the art selection screen.
 
sig_art _signal_art
 Emitted when the user selects an album art image.
 
Gtk::Button * _done_button
 Done button on the art selection screen.
 
Gtk::Viewport * _viewport
 Viewport that displays the grid of album art.
 
Gtk::Grid * _grid
 Grid of album art.
 

Static Private Attributes

static constexpr int SPACING = 16
 The spacing between images.
 

Additional Inherited Members

- Protected Member Functions inherited from Component
 Component ()
 
virtual ~Component ()=0
 

Detailed Description

Handles the interactions with the album art selection screen.

Definition at line 25 of file album_art_component.h.

Member Typedef Documentation

◆ sig_art

typedef sigc::signal<void(const std::string)> AlbumArtComponent::sig_art

"Art selected" signal type.

Definition at line 33 of file album_art_component.h.

◆ sig_done

typedef sigc::signal<void()> AlbumArtComponent::sig_done

"Done with screen" signal type.

Definition at line 30 of file album_art_component.h.

Constructor & Destructor Documentation

◆ AlbumArtComponent()

AlbumArtComponent::AlbumArtComponent ( Glib::RefPtr< Gtk::Builder > builder)

AlbumArtComponent constructor.

Parameters
[in]builderThe builder initialized with the widgets on the album art selection screen.

Definition at line 9 of file album_art_component.cc.

◆ ~AlbumArtComponent()

AlbumArtComponent::~AlbumArtComponent ( )

AlbumArtComponent destructior.

Definition at line 17 of file album_art_component.cc.

Member Function Documentation

◆ on_done_button_clicked()

void AlbumArtComponent::on_done_button_clicked ( )
private

Called when the "done" button is clicked.

Definition at line 83 of file album_art_component.cc.

◆ set_album_arts()

void AlbumArtComponent::set_album_arts ( const std::vector< AlbumArtProvider::AlbumArt > & arts,
const int window_width )

Set the album art images to show on the selection screen.

Parameters
[in]artsAlbum art images.
[in]window_widthThe current width of the application window. This is used to compute how many image columns to display.

Definition at line 31 of file album_art_component.cc.

◆ signal_art()

AlbumArtComponent::sig_art AlbumArtComponent::signal_art ( )

Getter for _signal_art.

Definition at line 27 of file album_art_component.cc.

◆ signal_done()

AlbumArtComponent::sig_done AlbumArtComponent::signal_done ( )

Getter for _signal_done.

Definition at line 23 of file album_art_component.cc.

Member Data Documentation

◆ _done_button

Gtk::Button* AlbumArtComponent::_done_button
private

Done button on the art selection screen.

Definition at line 61 of file album_art_component.h.

◆ _grid

Gtk::Grid* AlbumArtComponent::_grid
private

Grid of album art.

Definition at line 63 of file album_art_component.h.

◆ _signal_art

sig_art AlbumArtComponent::_signal_art
private

Emitted when the user selects an album art image.

Definition at line 59 of file album_art_component.h.

◆ _signal_done

sig_done AlbumArtComponent::_signal_done
private

Emitted when the user leaves the art selection screen.

Definition at line 58 of file album_art_component.h.

◆ _viewport

Gtk::Viewport* AlbumArtComponent::_viewport
private

Viewport that displays the grid of album art.

Definition at line 62 of file album_art_component.h.

◆ ART_SIZE

int AlbumArtComponent::ART_SIZE = 128
staticconstexpr

The width and height of art displayed on the album art selection screen.

Definition at line 36 of file album_art_component.h.

◆ SPACING

int AlbumArtComponent::SPACING = 16
staticconstexprprivate

The spacing between images.

Definition at line 56 of file album_art_component.h.


The documentation for this class was generated from the following files: