util/Error: new error passing library
Replaces GLib's GError.
This commit is contained in:
Makefile.am
src
AllCommands.cxxArchiveFile.hxxArchivePlugin.cxxArchivePlugin.hxxAudioConfig.cxxAudioParser.cxxAudioParser.hxxCheckAudioFormat.cxxCheckAudioFormat.hxxClientEvent.cxxClientFile.cxxClientFile.hxxClientInternal.hxxClientNew.cxxClientProcess.cxxCommandError.cxxCommandError.hxxCommandLine.cxxCommandLine.hxxConfigData.cxxConfigData.hxxConfigError.cxxConfigError.hxxConfigFile.cxxConfigFile.hxxConfigGlobal.cxxConfigGlobal.hxxConfigPath.cxxConfigPath.hxxDatabaseCommands.cxxDatabaseError.cxxDatabaseError.hxxDatabaseGlue.cxxDatabaseGlue.hxxDatabaseHelpers.cxxDatabaseHelpers.hxxDatabasePlaylist.cxxDatabasePlaylist.hxxDatabasePlugin.hxxDatabasePrint.cxxDatabasePrint.hxxDatabaseQueue.cxxDatabaseQueue.hxxDatabaseSave.cxxDatabaseSave.hxxDatabaseSimple.hxxDatabaseVisitor.hxxDecoderAPI.cxxDecoderControl.hxxDecoderError.cxxDecoderError.hxxDecoderThread.cxxDirectory.cxxDirectory.hxxDirectorySave.cxxDirectorySave.hxxEncoderPlugin.hxxFilterConfig.cxxFilterConfig.hxxFilterInternal.hxxFilterPlugin.cxxFilterPlugin.hxxInotifySource.cxxInotifySource.hxxInotifyUpdate.cxxInputInit.cxxInputInit.hxxInputLegacy.hxxInputPlugin.hxxInputStream.cxxListen.cxxListen.hxxLog.cxxLog.hxxMain.cxxMapper.hxxMixerAll.cxxMixerControl.cxxMixerControl.hxxMixerPlugin.hxxOtherCommands.cxxOutputAll.cxxOutputAll.hxxOutputControl.cxxOutputError.cxxOutputError.hxxOutputInit.cxxOutputInternal.hxxOutputPlugin.cxxOutputPlugin.hxxOutputThread.cxxPlayerControl.cxxPlayerControl.hxxPlayerThread.cxxPlaylistAny.cxxPlaylistCommands.cxxPlaylistDatabase.cxxPlaylistDatabase.hxxPlaylistEdit.cxxPlaylistError.cxxPlaylistError.hxxPlaylistFile.cxxPlaylistFile.hxxPlaylistPrint.cxxPlaylistPrint.hxxPlaylistRegistry.cxxPlaylistSave.cxxPlaylistSave.hxxPlaylistSong.cxxQueueCommands.cxxQueueSave.cxxSongSave.cxxSongSave.hxxSongSticker.hxxSongUpdate.cxxStats.cxxStickerCommands.cxxStickerDatabase.cxxStickerDatabase.hxxTagFile.cxxTagId3.cxxTagId3.hxxTextInputStream.cxxUpdateArchive.cxxUpdateGlue.cxx
archive
db
decoder
AdPlugDecoderPlugin.cxxAudiofileDecoderPlugin.cxxDsdLib.cxxDsdiffDecoderPlugin.cxxDsfDecoderPlugin.cxxFaadDecoderPlugin.cxxFfmpegDecoderPlugin.cxxFlacCommon.cxxFlacDecoderPlugin.cxxFlacIOHandle.cxxFlacInput.cxxFluidsynthDecoderPlugin.cxxGmeDecoderPlugin.cxxMadDecoderPlugin.cxxMpcdecDecoderPlugin.cxxMpg123DecoderPlugin.cxxOpusDecoderPlugin.cxxPcmDecoderPlugin.cxxSndfileDecoderPlugin.cxxVorbisDecoderPlugin.cxxWavpackDecoderPlugin.cxxWildmidiDecoderPlugin.cxx
encoder
FlacEncoderPlugin.cxxLameEncoderPlugin.cxxNullEncoderPlugin.cxxOpusEncoderPlugin.cxxTwolameEncoderPlugin.cxxVorbisEncoderPlugin.cxxWaveEncoderPlugin.cxx
event
filter
AutoConvertFilterPlugin.cxxChainFilterPlugin.cxxConvertFilterPlugin.cxxNormalizeFilterPlugin.cxxNullFilterPlugin.cxxReplayGainFilterPlugin.cxxRouteFilterPlugin.cxxVolumeFilterPlugin.cxx
input
ArchiveInputPlugin.cxxCdioParanoiaInputPlugin.cxxCurlInputPlugin.cxxDespotifyInputPlugin.cxxFfmpegInputPlugin.cxxFileInputPlugin.cxxMmsInputPlugin.cxxRewindInputPlugin.cxx
mixer
AlsaMixerPlugin.cxxOssMixerPlugin.cxxPulseMixerPlugin.cxxRoarMixerPlugin.cxxSoftwareMixerPlugin.cxxWinmmMixerPlugin.cxx
mpd_error.houtput
AlsaOutputPlugin.cxxAoOutputPlugin.cxxFifoOutputPlugin.cxxHttpdClient.cxxHttpdClient.hxxHttpdInternal.hxxHttpdOutputPlugin.cxxJackOutputPlugin.cxxNullOutputPlugin.cxxOSXOutputPlugin.cxxOpenALOutputPlugin.cxxOssOutputPlugin.cxxPipeOutputPlugin.cxxPulseOutputPlugin.cxxPulseOutputPlugin.hxxRecorderOutputPlugin.cxxRoarOutputPlugin.cxxShoutOutputPlugin.cxxSolarisOutputPlugin.cxxWinmmOutputPlugin.cxx
pcm
PcmConvert.cxxPcmConvert.hxxPcmResample.cxxPcmResample.hxxPcmResampleInternal.hxxPcmResampleLibsamplerate.cxx
playlist
AsxPlaylistPlugin.cxxLastFMPlaylistPlugin.cxxPlsPlaylistPlugin.cxxRssPlaylistPlugin.cxxSoundCloudPlaylistPlugin.cxxXspfPlaylistPlugin.cxx
protocol
system
FatalError.cxxFatalError.hxxResolver.cxxResolver.hxxSocketError.cxxSocketError.hxxSocketUtil.cxxSocketUtil.hxx
util
test
@@ -251,10 +251,10 @@ player_wait_for_decoder(struct player *player)
|
||||
|
||||
player->queued = false;
|
||||
|
||||
GError *error = dc->LockGetError();
|
||||
if (error != NULL) {
|
||||
Error error = dc->LockGetError();
|
||||
if (error.IsDefined()) {
|
||||
pc->Lock();
|
||||
pc->SetError(PLAYER_ERROR_DECODER, error);
|
||||
pc->SetError(PLAYER_ERROR_DECODER, std::move(error));
|
||||
|
||||
pc->next_song->Free();
|
||||
pc->next_song = NULL;
|
||||
@@ -327,9 +327,9 @@ player_open_output(struct player *player)
|
||||
assert(pc->state == PLAYER_STATE_PLAY ||
|
||||
pc->state == PLAYER_STATE_PAUSE);
|
||||
|
||||
GError *error = NULL;
|
||||
Error error;
|
||||
if (audio_output_all_open(player->play_audio_format, player_buffer,
|
||||
&error)) {
|
||||
error)) {
|
||||
player->output_open = true;
|
||||
player->paused = false;
|
||||
|
||||
@@ -341,7 +341,7 @@ player_open_output(struct player *player)
|
||||
|
||||
return true;
|
||||
} else {
|
||||
g_warning("%s", error->message);
|
||||
g_warning("%s", error.GetMessage());
|
||||
|
||||
player->output_open = false;
|
||||
|
||||
@@ -350,7 +350,7 @@ player_open_output(struct player *player)
|
||||
player->paused = true;
|
||||
|
||||
pc->Lock();
|
||||
pc->SetError(PLAYER_ERROR_OUTPUT, error);
|
||||
pc->SetError(PLAYER_ERROR_OUTPUT, std::move(error));
|
||||
pc->state = PLAYER_STATE_PAUSE;
|
||||
pc->Unlock();
|
||||
|
||||
@@ -377,13 +377,13 @@ player_check_decoder_startup(struct player *player)
|
||||
|
||||
dc->Lock();
|
||||
|
||||
GError *error = dc->GetError();
|
||||
if (error != NULL) {
|
||||
Error error = dc->GetError();
|
||||
if (error.IsDefined()) {
|
||||
/* the decoder failed */
|
||||
dc->Unlock();
|
||||
|
||||
pc->Lock();
|
||||
pc->SetError(PLAYER_ERROR_DECODER, error);
|
||||
pc->SetError(PLAYER_ERROR_DECODER, std::move(error));
|
||||
pc->Unlock();
|
||||
|
||||
return false;
|
||||
@@ -460,11 +460,9 @@ player_send_silence(struct player *player)
|
||||
chunk->length = num_frames * frame_size;
|
||||
memset(chunk->data, 0, chunk->length);
|
||||
|
||||
GError *error = NULL;
|
||||
if (!audio_output_all_play(chunk, &error)) {
|
||||
g_warning("%s", error->message);
|
||||
g_error_free(error);
|
||||
|
||||
Error error;
|
||||
if (!audio_output_all_play(chunk, error)) {
|
||||
g_warning("%s", error.GetMessage());
|
||||
music_buffer_return(player_buffer, chunk);
|
||||
return false;
|
||||
}
|
||||
@@ -689,7 +687,7 @@ static bool
|
||||
play_chunk(struct player_control *pc,
|
||||
Song *song, struct music_chunk *chunk,
|
||||
const AudioFormat format,
|
||||
GError **error_r)
|
||||
Error &error)
|
||||
{
|
||||
assert(chunk->CheckFormat(format));
|
||||
|
||||
@@ -707,7 +705,7 @@ play_chunk(struct player_control *pc,
|
||||
|
||||
/* send the chunk to the audio outputs */
|
||||
|
||||
if (!audio_output_all_play(chunk, error_r))
|
||||
if (!audio_output_all_play(chunk, error))
|
||||
return false;
|
||||
|
||||
pc->total_play_time += (double)chunk->length /
|
||||
@@ -822,16 +820,16 @@ play_next_chunk(struct player *player)
|
||||
|
||||
/* play the current chunk */
|
||||
|
||||
GError *error = NULL;
|
||||
Error error;
|
||||
if (!play_chunk(player->pc, player->song, chunk,
|
||||
player->play_audio_format, &error)) {
|
||||
g_warning("%s", error->message);
|
||||
player->play_audio_format, error)) {
|
||||
g_warning("%s", error.GetMessage());
|
||||
|
||||
music_buffer_return(player_buffer, chunk);
|
||||
|
||||
pc->Lock();
|
||||
|
||||
pc->SetError(PLAYER_ERROR_OUTPUT, error);
|
||||
pc->SetError(PLAYER_ERROR_OUTPUT, std::move(error));
|
||||
|
||||
/* pause: the user may resume playback as soon as an
|
||||
audio output becomes available */
|
||||
|
Reference in New Issue
Block a user