Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
11ec7117
Commit
11ec7117
authored
May 31, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partition: add `noexcept`
parent
c3ccbfd4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
27 deletions
+27
-27
Partition.cxx
src/Partition.cxx
+8
-8
Partition.hxx
src/Partition.hxx
+19
-19
No files found.
src/Partition.cxx
View file @
11ec7117
...
@@ -30,7 +30,7 @@ Partition::Partition(Instance &_instance,
...
@@ -30,7 +30,7 @@ Partition::Partition(Instance &_instance,
unsigned
max_length
,
unsigned
max_length
,
unsigned
buffer_chunks
,
unsigned
buffer_chunks
,
AudioFormat
configured_audio_format
,
AudioFormat
configured_audio_format
,
const
ReplayGainConfig
&
replay_gain_config
)
const
ReplayGainConfig
&
replay_gain_config
)
noexcept
:
instance
(
_instance
),
:
instance
(
_instance
),
name
(
_name
),
name
(
_name
),
listener
(
new
ClientListener
(
instance
.
event_loop
,
*
this
)),
listener
(
new
ClientListener
(
instance
.
event_loop
,
*
this
)),
...
@@ -46,13 +46,13 @@ Partition::Partition(Instance &_instance,
...
@@ -46,13 +46,13 @@ Partition::Partition(Instance &_instance,
Partition
::~
Partition
()
noexcept
=
default
;
Partition
::~
Partition
()
noexcept
=
default
;
void
void
Partition
::
EmitIdle
(
unsigned
mask
)
Partition
::
EmitIdle
(
unsigned
mask
)
noexcept
{
{
instance
.
EmitIdle
(
mask
);
instance
.
EmitIdle
(
mask
);
}
}
void
void
Partition
::
UpdateEffectiveReplayGainMode
()
Partition
::
UpdateEffectiveReplayGainMode
()
noexcept
{
{
auto
mode
=
replay_gain_mode
;
auto
mode
=
replay_gain_mode
;
if
(
mode
==
ReplayGainMode
::
AUTO
)
if
(
mode
==
ReplayGainMode
::
AUTO
)
...
@@ -68,7 +68,7 @@ Partition::UpdateEffectiveReplayGainMode()
...
@@ -68,7 +68,7 @@ Partition::UpdateEffectiveReplayGainMode()
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
const
Database
*
const
Database
*
Partition
::
GetDatabase
()
const
Partition
::
GetDatabase
()
const
noexcept
{
{
return
instance
.
GetDatabase
();
return
instance
.
GetDatabase
();
}
}
...
@@ -80,7 +80,7 @@ Partition::GetDatabaseOrThrow() const
...
@@ -80,7 +80,7 @@ Partition::GetDatabaseOrThrow() const
}
}
void
void
Partition
::
DatabaseModified
(
const
Database
&
db
)
Partition
::
DatabaseModified
(
const
Database
&
db
)
noexcept
{
{
playlist
.
DatabaseModified
(
db
);
playlist
.
DatabaseModified
(
db
);
EmitIdle
(
IDLE_DATABASE
);
EmitIdle
(
IDLE_DATABASE
);
...
@@ -89,7 +89,7 @@ Partition::DatabaseModified(const Database &db)
...
@@ -89,7 +89,7 @@ Partition::DatabaseModified(const Database &db)
#endif
#endif
void
void
Partition
::
TagModified
()
Partition
::
TagModified
()
noexcept
{
{
auto
song
=
pc
.
LockReadTaggedSong
();
auto
song
=
pc
.
LockReadTaggedSong
();
if
(
song
)
if
(
song
)
...
@@ -103,13 +103,13 @@ Partition::TagModified(const char *uri, const Tag &tag) noexcept
...
@@ -103,13 +103,13 @@ Partition::TagModified(const char *uri, const Tag &tag) noexcept
}
}
void
void
Partition
::
SyncWithPlayer
()
Partition
::
SyncWithPlayer
()
noexcept
{
{
playlist
.
SyncWithPlayer
(
pc
);
playlist
.
SyncWithPlayer
(
pc
);
}
}
void
void
Partition
::
BorderPause
()
Partition
::
BorderPause
()
noexcept
{
{
playlist
.
BorderPause
(
pc
);
playlist
.
BorderPause
(
pc
);
}
}
...
...
src/Partition.hxx
View file @
11ec7117
...
@@ -71,17 +71,17 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
...
@@ -71,17 +71,17 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
unsigned
max_length
,
unsigned
max_length
,
unsigned
buffer_chunks
,
unsigned
buffer_chunks
,
AudioFormat
configured_audio_format
,
AudioFormat
configured_audio_format
,
const
ReplayGainConfig
&
replay_gain_config
);
const
ReplayGainConfig
&
replay_gain_config
)
noexcept
;
~
Partition
()
noexcept
;
~
Partition
()
noexcept
;
void
EmitGlobalEvent
(
unsigned
mask
)
{
void
EmitGlobalEvent
(
unsigned
mask
)
noexcept
{
global_events
.
OrMask
(
mask
);
global_events
.
OrMask
(
mask
);
}
}
void
EmitIdle
(
unsigned
mask
);
void
EmitIdle
(
unsigned
mask
)
noexcept
;
void
ClearQueue
()
{
void
ClearQueue
()
noexcept
{
playlist
.
Clear
(
pc
);
playlist
.
Clear
(
pc
);
}
}
...
@@ -108,11 +108,11 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
...
@@ -108,11 +108,11 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
playlist
.
DeleteRange
(
pc
,
start
,
end
);
playlist
.
DeleteRange
(
pc
,
start
,
end
);
}
}
void
StaleSong
(
const
char
*
uri
)
{
void
StaleSong
(
const
char
*
uri
)
noexcept
{
playlist
.
StaleSong
(
pc
,
uri
);
playlist
.
StaleSong
(
pc
,
uri
);
}
}
void
Shuffle
(
unsigned
start
,
unsigned
end
)
{
void
Shuffle
(
unsigned
start
,
unsigned
end
)
noexcept
{
playlist
.
Shuffle
(
pc
,
start
,
end
);
playlist
.
Shuffle
(
pc
,
start
,
end
);
}
}
...
@@ -142,7 +142,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
...
@@ -142,7 +142,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
playlist
.
SetPriorityId
(
pc
,
song_id
,
priority
);
playlist
.
SetPriorityId
(
pc
,
song_id
,
priority
);
}
}
void
Stop
()
{
void
Stop
()
noexcept
{
playlist
.
Stop
(
pc
);
playlist
.
Stop
(
pc
);
}
}
...
@@ -174,27 +174,27 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
...
@@ -174,27 +174,27 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
playlist
.
SeekCurrent
(
pc
,
seek_time
,
relative
);
playlist
.
SeekCurrent
(
pc
,
seek_time
,
relative
);
}
}
void
SetRepeat
(
bool
new_value
)
{
void
SetRepeat
(
bool
new_value
)
noexcept
{
playlist
.
SetRepeat
(
pc
,
new_value
);
playlist
.
SetRepeat
(
pc
,
new_value
);
}
}
bool
GetRandom
()
const
{
bool
GetRandom
()
const
noexcept
{
return
playlist
.
GetRandom
();
return
playlist
.
GetRandom
();
}
}
void
SetRandom
(
bool
new_value
)
{
void
SetRandom
(
bool
new_value
)
noexcept
{
playlist
.
SetRandom
(
pc
,
new_value
);
playlist
.
SetRandom
(
pc
,
new_value
);
}
}
void
SetSingle
(
SingleMode
new_value
)
{
void
SetSingle
(
SingleMode
new_value
)
noexcept
{
playlist
.
SetSingle
(
pc
,
new_value
);
playlist
.
SetSingle
(
pc
,
new_value
);
}
}
void
SetConsume
(
bool
new_value
)
{
void
SetConsume
(
bool
new_value
)
noexcept
{
playlist
.
SetConsume
(
new_value
);
playlist
.
SetConsume
(
new_value
);
}
}
void
SetReplayGainMode
(
ReplayGainMode
mode
)
{
void
SetReplayGainMode
(
ReplayGainMode
mode
)
noexcept
{
replay_gain_mode
=
mode
;
replay_gain_mode
=
mode
;
UpdateEffectiveReplayGainMode
();
UpdateEffectiveReplayGainMode
();
}
}
...
@@ -203,7 +203,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
...
@@ -203,7 +203,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
* Publishes the effective #ReplayGainMode to all subsystems.
* Publishes the effective #ReplayGainMode to all subsystems.
* #ReplayGainMode::AUTO is substituted.
* #ReplayGainMode::AUTO is substituted.
*/
*/
void
UpdateEffectiveReplayGainMode
();
void
UpdateEffectiveReplayGainMode
()
noexcept
;
#ifdef ENABLE_DATABASE
#ifdef ENABLE_DATABASE
/**
/**
...
@@ -211,7 +211,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
...
@@ -211,7 +211,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
* if this MPD configuration has no database (no
* if this MPD configuration has no database (no
* music_directory was configured).
* music_directory was configured).
*/
*/
const
Database
*
GetDatabase
()
const
;
const
Database
*
GetDatabase
()
const
noexcept
;
const
Database
&
GetDatabaseOrThrow
()
const
;
const
Database
&
GetDatabaseOrThrow
()
const
;
...
@@ -219,14 +219,14 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
...
@@ -219,14 +219,14 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
* The database has been modified. Propagate the change to
* The database has been modified. Propagate the change to
* all subsystems.
* all subsystems.
*/
*/
void
DatabaseModified
(
const
Database
&
db
);
void
DatabaseModified
(
const
Database
&
db
)
noexcept
;
#endif
#endif
/**
/**
* A tag in the play queue has been modified by the player
* A tag in the play queue has been modified by the player
* thread. Propagate the change to all subsystems.
* thread. Propagate the change to all subsystems.
*/
*/
void
TagModified
();
void
TagModified
()
noexcept
;
/**
/**
* The tag of the given song has been modified. Propagate the
* The tag of the given song has been modified. Propagate the
...
@@ -237,13 +237,13 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
...
@@ -237,13 +237,13 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
/**
/**
* Synchronize the player with the play queue.
* Synchronize the player with the play queue.
*/
*/
void
SyncWithPlayer
();
void
SyncWithPlayer
()
noexcept
;
/**
/**
* Border pause has just been enabled. Change single mode to off
* Border pause has just been enabled. Change single mode to off
* if it was one-shot.
* if it was one-shot.
*/
*/
void
BorderPause
();
void
BorderPause
()
noexcept
;
private
:
private
:
/* virtual methods from class QueueListener */
/* virtual methods from class QueueListener */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment