Skip to content

Commit

Permalink
Make some strings translatable so they can be passed on to user
Browse files Browse the repository at this point in the history
  • Loading branch information
jyavenard committed Jul 6, 2013
1 parent 2689340 commit 10fcf33
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmyth/audio/audiooutputalsa.cpp
Expand Up @@ -475,7 +475,7 @@ bool AudioOutputALSA::OpenDevice()
case FORMAT_S32: format = SND_PCM_FORMAT_S32; break;
case FORMAT_FLT: format = SND_PCM_FORMAT_FLOAT; break;
default:
Error(QString("Unknown sample format: %1").arg(output_format));
Error(QObject::tr("Unknown sample format: %1").arg(output_format));
return false;
}

Expand Down Expand Up @@ -679,7 +679,7 @@ int AudioOutputALSA::SetParameters(snd_pcm_t *handle, snd_pcm_format_t format,

if (handle == NULL)
{
Error("SetParameters() called with handle == NULL!");
Error(QObject::tr("SetParameters() called with handle == NULL!"));
return -1;
}

Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmyth/audio/audiooutputbase.cpp
Expand Up @@ -650,8 +650,8 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_settings)

if (needs_downmix && source_channels > 8)
{
Error("Aborting Audio Reconfigure. "
"Can't handle audio with more than 8 channels.");
Error(QObject::tr("Aborting Audio Reconfigure. "
"Can't handle audio with more than 8 channels."));
return;
}

Expand Down Expand Up @@ -702,7 +702,7 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_settings)
src_ctx = src_new(2-src_quality, chans, &error);
if (error)
{
Error(QString("Error creating resampler: %1")
Error(QObject::tr("Error creating resampler: %1")
.arg(src_strerror(error)));
src_ctx = NULL;
return;
Expand Down Expand Up @@ -738,7 +738,7 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_settings)
if (!encoder->Init(AV_CODEC_ID_AC3, 448000, samplerate,
configured_channels))
{
Error("AC-3 encoder initialization failed");
Error(QObject::tr("AC-3 encoder initialization failed"));
delete encoder;
encoder = NULL;
enc = false;
Expand Down Expand Up @@ -799,7 +799,7 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_settings)
if (!OpenDevice())
{
if (GetError().isEmpty())
Error("Aborting reconfigure");
Error(QObject::tr("Aborting reconfigure"));
else
VBGENERAL("Aborting reconfigure");
m_configure_succeeded = false;
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmyth/audio/audiooutputdx.cpp
Expand Up @@ -435,7 +435,7 @@ bool AudioOutputDX::OpenDevice(void)
m_priv->InitDirectSound(m_UseSPDIF);
if (!m_priv->dsobject || !m_priv->dsound_dll)
{
Error("DirectSound initialization failed");
Error(QObject::tr("DirectSound initialization failed"));
return false;
}

Expand Down Expand Up @@ -507,10 +507,10 @@ bool AudioOutputDX::OpenDevice(void)
if (FAILED(dsresult))
{
if (dsresult == DSERR_UNSUPPORTED)
Error(QString("Unsupported format for device %1:%2")
Error(QObject::tr("Unsupported format for device %1:%2")
.arg(m_priv->device_num).arg(m_priv->device_name));
else
Error(QString("Failed to create DS buffer 0x%1")
Error(QObject::tr("Failed to create DS buffer 0x%1")
.arg((DWORD)dsresult, 0, 16));
return false;
}
Expand Down
30 changes: 15 additions & 15 deletions mythtv/libs/libmyth/audio/audiooutputjack.cpp
Expand Up @@ -65,8 +65,8 @@ AudioOutputSettings* AudioOutputJACK::GetOutputSettings(bool /*digital*/)
client = _jack_client_open();
if (!client)
{
JERROR("Cannot start/connect to jack server "
"(to check supported rate/channels)");
JERROR(QObject::tr("Cannot start/connect to jack server "
"(to check supported rate/channels)"));
delete settings;
return NULL;
}
Expand All @@ -76,7 +76,7 @@ AudioOutputSettings* AudioOutputJACK::GetOutputSettings(bool /*digital*/)

if (!rate)
{
JERROR("Unable to retrieve jack server sample rate");
JERROR(QObject::tr("Unable to retrieve jack server sample rate"));
goto err_out;
}
else
Expand All @@ -90,7 +90,7 @@ AudioOutputSettings* AudioOutputJACK::GetOutputSettings(bool /*digital*/)

if (!matching_ports || !matching_ports[0])
{
JERROR("No ports available to connect to");
JERROR(QObject::tr("No ports available to connect to"));
goto err_out;
}
// Count matching ports from 2nd port upwards
Expand Down Expand Up @@ -130,7 +130,7 @@ bool AudioOutputJACK::OpenDevice()
// We have a hard coded channel limit - check we haven't exceeded it
if (channels > JACK_CHANNELS_MAX)
{
JERROR(QString("Requested more channels: (%1), than the maximum: %2")
JERROR(QObject::tr("Requested more channels: (%1), than the maximum: %2")
.arg(channels).arg(JACK_CHANNELS_MAX));
return false;
}
Expand All @@ -146,15 +146,15 @@ bool AudioOutputJACK::OpenDevice()
client = _jack_client_open();
if (!client)
{
JERROR("Cannot start/connect to jack server");
JERROR(QObject::tr("Cannot start/connect to jack server"));
goto err_out;
}

// Find some Jack ports to connect to
matching_ports = _jack_get_ports();
if (!matching_ports || !matching_ports[0])
{
JERROR("No ports available to connect to");
JERROR(QObject::tr("No ports available to connect to"));
goto err_out;
}

Expand All @@ -165,7 +165,7 @@ bool AudioOutputJACK::OpenDevice()
// ensure enough ports to satisfy request
if (channels > i)
{
JERROR("Not enough ports available to connect to");
JERROR(QObject::tr("Not enough ports available to connect to"));
goto err_out;
}

Expand All @@ -178,7 +178,7 @@ bool AudioOutputJACK::OpenDevice()
JackPortIsOutput, 0);
if (!ports[i])
{
JERROR(QString("Error while registering new jack port: %1").arg(i));
JERROR(QObject::tr("Error while registering new jack port: %1").arg(i));
goto err_out;
}
}
Expand All @@ -199,16 +199,16 @@ bool AudioOutputJACK::OpenDevice()
// These will actually get called after jack_activate()!
// ...Possibly even before this OpenDevice sub returns...
if (jack_set_process_callback(client, _JackCallback, this))
JERROR("Error. Unable to set process callback?!");
JERROR(QObject::tr("Error. Unable to set process callback?!"));
if (jack_set_xrun_callback(client, _JackXRunCallback, this))
JERROR("Error. Unable to set xrun callback?!");
JERROR(QObject::tr("Error. Unable to set xrun callback?!"));
if (jack_set_graph_order_callback(client, _JackGraphOrderCallback, this))
JERROR("Error. Unable to set graph order change callback?!");
JERROR(QObject::tr("Error. Unable to set graph order change callback?!"));

// Activate! Everything comes into life after here. Beware races
if (jack_activate(client))
{
JERROR("Calling jack_activate failed");
JERROR(QObject::tr("Calling jack_activate failed"));
goto err_out;
}

Expand Down Expand Up @@ -615,7 +615,7 @@ bool AudioOutputJACK::_jack_connect_ports(const char** matching_ports)
{
if (jack_connect(client, jack_port_name(ports[i]), matching_ports[i]))
{
JERROR(QString("Calling jack_connect failed on port: %1\n").arg(i));
JERROR(QObject::tr("Calling jack_connect failed on port: %1\n").arg(i));
return false;
}
}
Expand All @@ -629,7 +629,7 @@ void AudioOutputJACK::_jack_client_close(jack_client_t **client)
{
int err = jack_client_close(*client);
if (err != 0)
JERROR(QString("Error closing Jack output device. Error: %1")
JERROR(QObject::tr("Error closing Jack output device. Error: %1")
.arg(err));
*client = NULL;
}
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmyth/audio/audiooutputoss.cpp
Expand Up @@ -140,6 +140,7 @@ bool AudioOutputOSS::OpenDevice()

if (audiofd == -1)
{
Error(QObject::tr("Error opening audio device (%1)").arg(main_device));
VBERRENO(QString("Error opening audio device (%1)").arg(main_device));
return false;
}
Expand Down

0 comments on commit 10fcf33

Please sign in to comment.