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

Handles the interactions with the album labels, track listing and ipod/eject buttons. More...

#include <disc_component.h>

Inheritance diagram for DiscComponent:
Collaboration diagram for DiscComponent:

Classes

class  TracksListColumnRecord
 Track list columns. More...
 

Public Types

typedef sigc::signal< void(DriveManager::Drive)> sig_eject_requested
 "Drive eject requested" signal type.
 
typedef sigc::signal< void(unsigned int)> sig_track_selected
 "Track selected" signal type.
 
typedef sigc::signal< void(unsigned int)> sig_rip_requested
 "Rip requested" signal type.
 

Public Member Functions

 DiscComponent (DriveManager &drive_manager, Glib::RefPtr< Gtk::Builder > builder)
 DiscComponent constructor.
 
 ~DiscComponent ()
 DiscComponent destructor.
 
void set_disc (const DiscDB::Disc *const disc)
 Sets the DiscDB::Disc containing all information about the inserted disc.
 
void clear_selection ()
 Clears the selection in the track listing.
 
void set_selection (unsigned int track)
 Sets the selection in the track listing.
 
void show_progress (const bool show)
 Shows or hides the rip progress column in the track listing.
 
void update_track_progress (unsigned int track, unsigned int progress)
 Updates the percentage completion in the track listing for a given track with a given percentage.
 
void show_ipod_button (const bool show)
 Shows or hides the iPod button (rip button).
 
void enable_ipod_button (const bool enable)
 Enables or disables the iPod button (rip button).
 
void enable_eject_button (const bool enable)
 Enables or disables the normal eject button.
 
void show_double_eject_button (const bool show)
 Switches between the normal eject button and the eject button with disc/iPod selection.
 
sig_eject_requested signal_eject_requested ()
 Getter for _signal_eject_requested.
 
sig_rip_requested signal_rip_requested ()
 Getter for _signal_rip_requested.
 
sig_track_selected signal_track_selected ()
 Getter for _signal_track_selected.
 

Private Member Functions

void on_eject (const DriveManager::Drive drive)
 Called after successful ejection of a drive.
 
void on_eject_button_clicked ()
 Called when the normal eject button is clicked.
 
void on_ipod_button_clicked ()
 Called when the iPod (rip) button is clicked.
 
void on_row_activated (const Gtk::TreeModel::Path &path, Gtk::TreeView::Column *)
 Called when a track is double-clicked in the track list.
 

Private Attributes

DriveManager_drive_manager
 Used to eject the disc.
 
Gtk::Label * _album_label
 Label displaying the album title.
 
Gtk::Label * _album_artist_label
 Label displaying the album artist.
 
Gtk::Button * _eject_button
 Normal eject button.
 
Gtk::Stack * _eject_button_stack
 Stack that switches between eject buttons.
 
Gtk::MenuButton * _double_eject_button
 Eject button with disc/iPod selection.
 
Glib::RefPtr< Gio::Menu > _double_eject_button_menu
 Disc/iPod eject button selection menu.
 
Glib::RefPtr< Gio::SimpleActionGroup > _eject_action_group
 Action group for disc/iPod eject button menu.
 
Gtk::Button * _ipod_button
 Shown when the iPod is connected, enabled when ripping is possible.
 
Gtk::TreeView * _tracks_tree_view
 Shows the track list.
 
Glib::RefPtr< Gtk::ListStore > _tracks_list_store
 Track list model.
 
sig_eject_requested _signal_eject_requested
 Emitted when an eject button is used.
 
sig_rip_requested _signal_rip_requested
 Emitted when the iPod (rip) button is clicked.
 
sig_track_selected _signal_track_selected
 Emitted when a track is double-clicked in the track list.
 

Additional Inherited Members

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

Detailed Description

Handles the interactions with the album labels, track listing and ipod/eject buttons.

Definition at line 35 of file disc_component.h.

Member Typedef Documentation

◆ sig_eject_requested

"Drive eject requested" signal type.

Definition at line 38 of file disc_component.h.

◆ sig_rip_requested

typedef sigc::signal<void(unsigned int)> DiscComponent::sig_rip_requested

"Rip requested" signal type.

Definition at line 44 of file disc_component.h.

◆ sig_track_selected

typedef sigc::signal<void(unsigned int)> DiscComponent::sig_track_selected

"Track selected" signal type.

Definition at line 41 of file disc_component.h.

Constructor & Destructor Documentation

◆ DiscComponent()

DiscComponent::DiscComponent ( DriveManager & drive_manager,
Glib::RefPtr< Gtk::Builder > builder )

DiscComponent constructor.

Parameters
[in]drive_managerUsed to eject the disc .
[in]builderThe builder initialized with the widgets managed by this component.

Definition at line 9 of file disc_component.cc.

◆ ~DiscComponent()

DiscComponent::~DiscComponent ( )

DiscComponent destructor.

Definition at line 57 of file disc_component.cc.

Member Function Documentation

◆ clear_selection()

void DiscComponent::clear_selection ( )

Clears the selection in the track listing.

Definition at line 99 of file disc_component.cc.

◆ enable_eject_button()

void DiscComponent::enable_eject_button ( const bool enable)

Enables or disables the normal eject button.

Parameters
[in]enableWnable (true) or disable (false).

Definition at line 143 of file disc_component.cc.

◆ enable_ipod_button()

void DiscComponent::enable_ipod_button ( const bool enable)

Enables or disables the iPod button (rip button).

Parameters
[in]enableWnable (true) or disable (false).

Definition at line 139 of file disc_component.cc.

◆ on_eject()

void DiscComponent::on_eject ( const DriveManager::Drive drive)
private

Called after successful ejection of a drive.

Parameters
[in]driveThe drive that was ejected (disc or iPod) .

Definition at line 160 of file disc_component.cc.

◆ on_eject_button_clicked()

void DiscComponent::on_eject_button_clicked ( )
private

Called when the normal eject button is clicked.

Definition at line 151 of file disc_component.cc.

◆ on_ipod_button_clicked()

void DiscComponent::on_ipod_button_clicked ( )
private

Called when the iPod (rip) button is clicked.

Definition at line 167 of file disc_component.cc.

◆ on_row_activated()

void DiscComponent::on_row_activated ( const Gtk::TreeModel::Path & path,
Gtk::TreeView::Column *  )
private

Called when a track is double-clicked in the track list.

Parameters
[in]pathTree path to the track row double-clicked.

Definition at line 181 of file disc_component.cc.

◆ set_disc()

void DiscComponent::set_disc ( const DiscDB::Disc *const disc)

Sets the DiscDB::Disc containing all information about the inserted disc.

Parameters
[in]discThe album information.

Definition at line 68 of file disc_component.cc.

◆ set_selection()

void DiscComponent::set_selection ( unsigned int track)

Sets the selection in the track listing.

Parameters
[in]trackThe 1-based index of the track to select.

Definition at line 103 of file disc_component.cc.

◆ show_double_eject_button()

void DiscComponent::show_double_eject_button ( const bool show)

Switches between the normal eject button and the eject button with disc/iPod selection.

Parameters
[in]showShow (true) or hide (false).

Definition at line 147 of file disc_component.cc.

◆ show_ipod_button()

void DiscComponent::show_ipod_button ( const bool show)

Shows or hides the iPod button (rip button).

Parameters
[in]showShow (true) or hide (false).

Definition at line 135 of file disc_component.cc.

◆ show_progress()

void DiscComponent::show_progress ( const bool show)

Shows or hides the rip progress column in the track listing.

Parameters
[in]showShow (true) or hide (false).

Definition at line 64 of file disc_component.cc.

◆ signal_eject_requested()

DiscComponent::sig_eject_requested DiscComponent::signal_eject_requested ( )

Getter for _signal_eject_requested.

Definition at line 111 of file disc_component.cc.

◆ signal_rip_requested()

DiscComponent::sig_rip_requested DiscComponent::signal_rip_requested ( )

Getter for _signal_rip_requested.

Definition at line 115 of file disc_component.cc.

◆ signal_track_selected()

DiscComponent::sig_track_selected DiscComponent::signal_track_selected ( )

Getter for _signal_track_selected.

Definition at line 120 of file disc_component.cc.

◆ update_track_progress()

void DiscComponent::update_track_progress ( unsigned int track,
unsigned int progress )

Updates the percentage completion in the track listing for a given track with a given percentage.

Parameters
[in]track1-based index of the track to update.
[in]progressNew percentage completion.

Definition at line 124 of file disc_component.cc.

Member Data Documentation

◆ _album_artist_label

Gtk::Label* DiscComponent::_album_artist_label
private

Label displaying the album artist.

Definition at line 118 of file disc_component.h.

◆ _album_label

Gtk::Label* DiscComponent::_album_label
private

Label displaying the album title.

Definition at line 117 of file disc_component.h.

◆ _double_eject_button

Gtk::MenuButton* DiscComponent::_double_eject_button
private

Eject button with disc/iPod selection.

Definition at line 122 of file disc_component.h.

◆ _double_eject_button_menu

Glib::RefPtr<Gio::Menu> DiscComponent::_double_eject_button_menu
private

Disc/iPod eject button selection menu.

Definition at line 123 of file disc_component.h.

◆ _drive_manager

DriveManager& DiscComponent::_drive_manager
private

Used to eject the disc.

Definition at line 115 of file disc_component.h.

◆ _eject_action_group

Glib::RefPtr<Gio::SimpleActionGroup> DiscComponent::_eject_action_group
private

Action group for disc/iPod eject button menu.

Definition at line 124 of file disc_component.h.

◆ _eject_button

Gtk::Button* DiscComponent::_eject_button
private

Normal eject button.

Definition at line 120 of file disc_component.h.

◆ _eject_button_stack

Gtk::Stack* DiscComponent::_eject_button_stack
private

Stack that switches between eject buttons.

Definition at line 121 of file disc_component.h.

◆ _ipod_button

Gtk::Button* DiscComponent::_ipod_button
private

Shown when the iPod is connected, enabled when ripping is possible.

Definition at line 126 of file disc_component.h.

◆ _signal_eject_requested

sig_eject_requested DiscComponent::_signal_eject_requested
private

Emitted when an eject button is used.

Definition at line 130 of file disc_component.h.

◆ _signal_rip_requested

sig_rip_requested DiscComponent::_signal_rip_requested
private

Emitted when the iPod (rip) button is clicked.

Definition at line 131 of file disc_component.h.

◆ _signal_track_selected

sig_track_selected DiscComponent::_signal_track_selected
private

Emitted when a track is double-clicked in the track list.

Definition at line 132 of file disc_component.h.

◆ _tracks_list_store

Glib::RefPtr<Gtk::ListStore> DiscComponent::_tracks_list_store
private

Track list model.

Definition at line 128 of file disc_component.h.

◆ _tracks_tree_view

Gtk::TreeView* DiscComponent::_tracks_tree_view
private

Shows the track list.

Definition at line 127 of file disc_component.h.


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