Merge pull request #4904 from clementine-player/revert-4903-master
Revert "Add track intro mode"
This commit is contained in:
commit
b077fe97cf
@ -127,7 +127,6 @@ enum RepeatMode {
|
|||||||
Repeat_Album = 2;
|
Repeat_Album = 2;
|
||||||
Repeat_Playlist = 3;
|
Repeat_Playlist = 3;
|
||||||
Repeat_OneByOne = 4;
|
Repeat_OneByOne = 4;
|
||||||
Repeat_Intro = 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valid Shuffle modes
|
// Valid Shuffle modes
|
||||||
|
@ -589,8 +589,6 @@ void Player::TrackAboutToEnd() {
|
|||||||
next_item->Metadata().end_nanosec());
|
next_item->Metadata().end_nanosec());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::IntroPointReached() { NextInternal(Engine::Intro); }
|
|
||||||
|
|
||||||
void Player::ValidSongRequested(const QUrl& url) {
|
void Player::ValidSongRequested(const QUrl& url) {
|
||||||
emit SongChangeRequestProcessed(url, true);
|
emit SongChangeRequestProcessed(url, true);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ class PlayerInterface : public QObject {
|
|||||||
virtual void Play() = 0;
|
virtual void Play() = 0;
|
||||||
virtual void ShowOSD() = 0;
|
virtual void ShowOSD() = 0;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void Playing();
|
void Playing();
|
||||||
void Paused();
|
void Paused();
|
||||||
void Stopped();
|
void Stopped();
|
||||||
@ -163,7 +163,6 @@ class Player : public PlayerInterface {
|
|||||||
void Pause();
|
void Pause();
|
||||||
void Stop(bool stop_after = false);
|
void Stop(bool stop_after = false);
|
||||||
void StopAfterCurrent();
|
void StopAfterCurrent();
|
||||||
void IntroPointReached();
|
|
||||||
void Play();
|
void Play();
|
||||||
void ShowOSD();
|
void ShowOSD();
|
||||||
void TogglePrettyOSD();
|
void TogglePrettyOSD();
|
||||||
|
@ -27,7 +27,6 @@ enum TrackChangeType {
|
|||||||
First = 0x01,
|
First = 0x01,
|
||||||
Manual = 0x02,
|
Manual = 0x02,
|
||||||
Auto = 0x04,
|
Auto = 0x04,
|
||||||
Intro = 0x08,
|
|
||||||
|
|
||||||
// Any of:
|
// Any of:
|
||||||
SameAlbum = 0x10,
|
SameAlbum = 0x10,
|
||||||
|
@ -302,8 +302,8 @@ void GstEngine::UpdateScope(int chunk_length) {
|
|||||||
gst_buffer_map(latest_buffer_, &map, GST_MAP_READ);
|
gst_buffer_map(latest_buffer_, &map, GST_MAP_READ);
|
||||||
|
|
||||||
// determine where to split the buffer
|
// determine where to split the buffer
|
||||||
int chunk_density =
|
int chunk_density = (map.size * kNsecPerMsec) /
|
||||||
(map.size * kNsecPerMsec) / GST_BUFFER_DURATION(latest_buffer_);
|
GST_BUFFER_DURATION(latest_buffer_);
|
||||||
|
|
||||||
int chunk_size = chunk_length * chunk_density;
|
int chunk_size = chunk_length * chunk_density;
|
||||||
|
|
||||||
@ -321,9 +321,10 @@ void GstEngine::UpdateScope(int chunk_length) {
|
|||||||
|
|
||||||
// make sure we don't go beyond the end of the buffer
|
// make sure we don't go beyond the end of the buffer
|
||||||
if (scope_chunk_ == scope_chunks_ - 1) {
|
if (scope_chunk_ == scope_chunks_ - 1) {
|
||||||
bytes = qMin(static_cast<Engine::Scope::size_type>(
|
bytes =
|
||||||
map.size - (chunk_size * scope_chunk_)),
|
qMin(static_cast<Engine::Scope::size_type>(
|
||||||
scope_.size() * sizeof(sample_type));
|
map.size - (chunk_size * scope_chunk_)),
|
||||||
|
scope_.size() * sizeof(sample_type));
|
||||||
} else {
|
} else {
|
||||||
bytes = qMin(static_cast<Engine::Scope::size_type>(chunk_size),
|
bytes = qMin(static_cast<Engine::Scope::size_type>(chunk_size),
|
||||||
scope_.size() * sizeof(sample_type));
|
scope_.size() * sizeof(sample_type));
|
||||||
@ -379,9 +380,7 @@ bool GstEngine::Load(const QUrl& url, Engine::TrackChangeFlags change,
|
|||||||
|
|
||||||
bool crossfade =
|
bool crossfade =
|
||||||
current_pipeline_ && ((crossfade_enabled_ && change & Engine::Manual) ||
|
current_pipeline_ && ((crossfade_enabled_ && change & Engine::Manual) ||
|
||||||
(autocrossfade_enabled_ && change & Engine::Auto) ||
|
(autocrossfade_enabled_ && change & Engine::Auto));
|
||||||
((crossfade_enabled_ || autocrossfade_enabled_) &&
|
|
||||||
change & Engine::Intro));
|
|
||||||
|
|
||||||
if (change & Engine::Auto && change & Engine::SameAlbum &&
|
if (change & Engine::Auto && change & Engine::SameAlbum &&
|
||||||
!crossfade_same_album_)
|
!crossfade_same_album_)
|
||||||
@ -768,8 +767,9 @@ GstEngine::PluginDetailsList GstEngine::GetPluginList(
|
|||||||
if (QString(gst_element_factory_get_klass(factory)).contains(classname)) {
|
if (QString(gst_element_factory_get_klass(factory)).contains(classname)) {
|
||||||
PluginDetails details;
|
PluginDetails details;
|
||||||
details.name = QString::fromUtf8(gst_plugin_feature_get_name(p->data));
|
details.name = QString::fromUtf8(gst_plugin_feature_get_name(p->data));
|
||||||
details.description = QString::fromUtf8(gst_element_factory_get_metadata(
|
details.description = QString::fromUtf8(
|
||||||
factory, GST_ELEMENT_METADATA_DESCRIPTION));
|
gst_element_factory_get_metadata(factory,
|
||||||
|
GST_ELEMENT_METADATA_DESCRIPTION));
|
||||||
ret << details;
|
ret << details;
|
||||||
}
|
}
|
||||||
p = g_list_next(p);
|
p = g_list_next(p);
|
||||||
|
@ -79,8 +79,10 @@ void OutgoingDataCreator::SetClients(QList<RemoteClient*>* clients) {
|
|||||||
SLOT(ResultsAvailable(int, SearchProvider::ResultList)),
|
SLOT(ResultsAvailable(int, SearchProvider::ResultList)),
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
connect(app_->global_search(), SIGNAL(SearchFinished(int)),
|
connect(app_->global_search(),
|
||||||
SLOT(SearchFinished(int)), Qt::QueuedConnection);
|
SIGNAL(SearchFinished(int)),
|
||||||
|
SLOT(SearchFinished(int)),
|
||||||
|
Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutgoingDataCreator::CheckEnabledProviders() {
|
void OutgoingDataCreator::CheckEnabledProviders() {
|
||||||
@ -377,11 +379,9 @@ void OutgoingDataCreator::CreateSong(const Song& song, const QImage& art,
|
|||||||
song_metadata->set_file_size(song.filesize());
|
song_metadata->set_file_size(song.filesize());
|
||||||
song_metadata->set_rating(song.rating());
|
song_metadata->set_rating(song.rating());
|
||||||
song_metadata->set_url(DataCommaSizeFromQString(song.url().toString()));
|
song_metadata->set_url(DataCommaSizeFromQString(song.url().toString()));
|
||||||
song_metadata->set_art_automatic(
|
song_metadata->set_art_automatic(DataCommaSizeFromQString(song.art_automatic()));
|
||||||
DataCommaSizeFromQString(song.art_automatic()));
|
|
||||||
song_metadata->set_art_manual(DataCommaSizeFromQString(song.art_manual()));
|
song_metadata->set_art_manual(DataCommaSizeFromQString(song.art_manual()));
|
||||||
song_metadata->set_type(
|
song_metadata->set_type(static_cast< ::pb::remote::SongMetadata_Type>(song.filetype()));
|
||||||
static_cast<::pb::remote::SongMetadata_Type>(song.filetype()));
|
|
||||||
|
|
||||||
// Append coverart
|
// Append coverart
|
||||||
if (!art.isNull()) {
|
if (!art.isNull()) {
|
||||||
@ -506,9 +506,6 @@ void OutgoingDataCreator::SendRepeatMode(PlaylistSequence::RepeatMode mode) {
|
|||||||
case PlaylistSequence::Repeat_OneByOne:
|
case PlaylistSequence::Repeat_OneByOne:
|
||||||
msg.mutable_repeat()->set_repeat_mode(pb::remote::Repeat_OneByOne);
|
msg.mutable_repeat()->set_repeat_mode(pb::remote::Repeat_OneByOne);
|
||||||
break;
|
break;
|
||||||
case PlaylistSequence::Repeat_Intro:
|
|
||||||
msg.mutable_repeat()->set_repeat_mode(pb::remote::Repeat_Intro);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SendDataToClients(&msg);
|
SendDataToClients(&msg);
|
||||||
@ -676,8 +673,7 @@ void OutgoingDataCreator::DoGlobalSearch(const QString& query,
|
|||||||
|
|
||||||
// Send status message
|
// Send status message
|
||||||
pb::remote::Message msg;
|
pb::remote::Message msg;
|
||||||
pb::remote::ResponseGlobalSearchStatus* status =
|
pb::remote::ResponseGlobalSearchStatus* status = msg.mutable_response_global_search_status();
|
||||||
msg.mutable_response_global_search_status();
|
|
||||||
|
|
||||||
msg.set_type(pb::remote::GLOBAL_SEARCH_STATUS);
|
msg.set_type(pb::remote::GLOBAL_SEARCH_STATUS);
|
||||||
status->set_id(id);
|
status->set_id(id);
|
||||||
@ -722,8 +718,7 @@ void OutgoingDataCreator::ResultsAvailable(
|
|||||||
|
|
||||||
client->SendData(&msg);
|
client->SendData(&msg);
|
||||||
|
|
||||||
qLog(Debug) << "ResultsAvailable" << id << results.first().provider_->name()
|
qLog(Debug) << "ResultsAvailable" << id << results.first().provider_->name() << results.size();
|
||||||
<< results.size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutgoingDataCreator::SearchFinished(int id) {
|
void OutgoingDataCreator::SearchFinished(int id) {
|
||||||
@ -733,8 +728,7 @@ void OutgoingDataCreator::SearchFinished(int id) {
|
|||||||
|
|
||||||
// Send status message
|
// Send status message
|
||||||
pb::remote::Message msg;
|
pb::remote::Message msg;
|
||||||
pb::remote::ResponseGlobalSearchStatus* status =
|
pb::remote::ResponseGlobalSearchStatus* status = msg.mutable_response_global_search_status();
|
||||||
msg.mutable_response_global_search_status();
|
|
||||||
|
|
||||||
msg.set_type(pb::remote::GLOBAL_SEARCH_STATUS);
|
msg.set_type(pb::remote::GLOBAL_SEARCH_STATUS);
|
||||||
status->set_id(req.id_);
|
status->set_id(req.id_);
|
||||||
|
@ -563,7 +563,6 @@ int Playlist::next_row(bool ignore_repeat_track) const {
|
|||||||
|
|
||||||
switch (playlist_sequence_->repeat_mode()) {
|
switch (playlist_sequence_->repeat_mode()) {
|
||||||
case PlaylistSequence::Repeat_Off:
|
case PlaylistSequence::Repeat_Off:
|
||||||
case PlaylistSequence::Repeat_Intro:
|
|
||||||
return -1;
|
return -1;
|
||||||
case PlaylistSequence::Repeat_Track:
|
case PlaylistSequence::Repeat_Track:
|
||||||
next_virtual_index = current_virtual_index_;
|
next_virtual_index = current_virtual_index_;
|
||||||
|
@ -53,7 +53,6 @@ PlaylistSequence::PlaylistSequence(QWidget* parent, SettingsProvider* settings)
|
|||||||
repeat_group->addAction(ui_->action_repeat_album);
|
repeat_group->addAction(ui_->action_repeat_album);
|
||||||
repeat_group->addAction(ui_->action_repeat_playlist);
|
repeat_group->addAction(ui_->action_repeat_playlist);
|
||||||
repeat_group->addAction(ui_->action_repeat_onebyone);
|
repeat_group->addAction(ui_->action_repeat_onebyone);
|
||||||
repeat_group->addAction(ui_->action_repeat_intro);
|
|
||||||
repeat_menu_->addActions(repeat_group->actions());
|
repeat_menu_->addActions(repeat_group->actions());
|
||||||
ui_->repeat->setMenu(repeat_menu_);
|
ui_->repeat->setMenu(repeat_menu_);
|
||||||
|
|
||||||
@ -121,7 +120,6 @@ void PlaylistSequence::RepeatActionTriggered(QAction* action) {
|
|||||||
if (action == ui_->action_repeat_album) mode = Repeat_Album;
|
if (action == ui_->action_repeat_album) mode = Repeat_Album;
|
||||||
if (action == ui_->action_repeat_playlist) mode = Repeat_Playlist;
|
if (action == ui_->action_repeat_playlist) mode = Repeat_Playlist;
|
||||||
if (action == ui_->action_repeat_onebyone) mode = Repeat_OneByOne;
|
if (action == ui_->action_repeat_onebyone) mode = Repeat_OneByOne;
|
||||||
if (action == ui_->action_repeat_intro) mode = Repeat_Intro;
|
|
||||||
|
|
||||||
SetRepeatMode(mode);
|
SetRepeatMode(mode);
|
||||||
}
|
}
|
||||||
@ -154,9 +152,6 @@ void PlaylistSequence::SetRepeatMode(RepeatMode mode) {
|
|||||||
case Repeat_OneByOne:
|
case Repeat_OneByOne:
|
||||||
ui_->action_repeat_onebyone->setChecked(true);
|
ui_->action_repeat_onebyone->setChecked(true);
|
||||||
break;
|
break;
|
||||||
case Repeat_Intro:
|
|
||||||
ui_->action_repeat_intro->setChecked(true);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode != repeat_mode_) {
|
if (mode != repeat_mode_) {
|
||||||
@ -250,9 +245,6 @@ void PlaylistSequence::CycleRepeatMode() {
|
|||||||
mode = Repeat_OneByOne;
|
mode = Repeat_OneByOne;
|
||||||
break;
|
break;
|
||||||
case Repeat_OneByOne:
|
case Repeat_OneByOne:
|
||||||
mode = Repeat_Intro;
|
|
||||||
break;
|
|
||||||
case Repeat_Intro:
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@ class PlaylistSequence : public QWidget {
|
|||||||
Repeat_Album = 2,
|
Repeat_Album = 2,
|
||||||
Repeat_Playlist = 3,
|
Repeat_Playlist = 3,
|
||||||
Repeat_OneByOne = 4,
|
Repeat_OneByOne = 4,
|
||||||
Repeat_Intro = 5,
|
|
||||||
};
|
};
|
||||||
enum ShuffleMode {
|
enum ShuffleMode {
|
||||||
Shuffle_Off = 0,
|
Shuffle_Off = 0,
|
||||||
|
@ -106,14 +106,6 @@
|
|||||||
<string>Stop after each track</string>
|
<string>Stop after each track</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_repeat_intro">
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Intro tracks</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="action_shuffle_off">
|
<action name="action_shuffle_off">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
@ -494,8 +494,6 @@ MainWindow::MainWindow(Application* app, SystemTrayIcon* tray_icon, OSD* osd,
|
|||||||
connect(app_->player(), SIGNAL(Seeked(qlonglong)), SLOT(Seeked(qlonglong)));
|
connect(app_->player(), SIGNAL(Seeked(qlonglong)), SLOT(Seeked(qlonglong)));
|
||||||
connect(app_->player(), SIGNAL(TrackSkipped(PlaylistItemPtr)),
|
connect(app_->player(), SIGNAL(TrackSkipped(PlaylistItemPtr)),
|
||||||
SLOT(TrackSkipped(PlaylistItemPtr)));
|
SLOT(TrackSkipped(PlaylistItemPtr)));
|
||||||
connect(this, SIGNAL(IntroPointReached()), app_->player(),
|
|
||||||
SLOT(IntroPointReached()));
|
|
||||||
connect(app_->player(), SIGNAL(VolumeChanged(int)), SLOT(VolumeChanged(int)));
|
connect(app_->player(), SIGNAL(VolumeChanged(int)), SLOT(VolumeChanged(int)));
|
||||||
|
|
||||||
connect(app_->player(), SIGNAL(Paused()), ui_->playlist,
|
connect(app_->player(), SIGNAL(Paused()), ui_->playlist,
|
||||||
@ -1340,13 +1338,6 @@ void MainWindow::UpdateTrackPosition() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// (just after) the scrobble point is a good point to change tracks in intro mode
|
|
||||||
if (position >= scrobble_point + 5) {
|
|
||||||
if (playlist->sequence()->repeat_mode() == PlaylistSequence::Repeat_Intro) {
|
|
||||||
emit IntroPointReached();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the tray icon every 10 seconds
|
// Update the tray icon every 10 seconds
|
||||||
if (position % 10 == 0) {
|
if (position % 10 == 0) {
|
||||||
qLog(Debug) << "position" << position << "scrobble point" << scrobble_point
|
qLog(Debug) << "position" << position << "scrobble point" << scrobble_point
|
||||||
|
@ -137,8 +137,6 @@ signals:
|
|||||||
// Signals that stop playing after track was toggled.
|
// Signals that stop playing after track was toggled.
|
||||||
void StopAfterToggled(bool stop);
|
void StopAfterToggled(bool stop);
|
||||||
|
|
||||||
void IntroPointReached();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void FilePathChanged(const QString& path);
|
void FilePathChanged(const QString& path);
|
||||||
|
|
||||||
|
@ -317,9 +317,6 @@ void OSD::RepeatModeChanged(PlaylistSequence::RepeatMode mode) {
|
|||||||
case PlaylistSequence::Repeat_OneByOne:
|
case PlaylistSequence::Repeat_OneByOne:
|
||||||
current_mode = tr("Stop after every track");
|
current_mode = tr("Stop after every track");
|
||||||
break;
|
break;
|
||||||
case PlaylistSequence::Repeat_Intro:
|
|
||||||
current_mode = tr("Intro tracks");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
ShowMessage(QCoreApplication::applicationName(), current_mode);
|
ShowMessage(QCoreApplication::applicationName(), current_mode);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user