Skip to content

Commit

Permalink
Audio.cpp: Drop redundant namespace prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jlnr committed May 1, 2017
1 parent f624e14 commit 41a421e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/Audio.cpp
Expand Up @@ -171,7 +171,7 @@ struct Gosu::Sample::SampleData
SampleData& operator=(const SampleData&);
};

Gosu::Sample::Sample(const std::string& filename)
Gosu::Sample::Sample(const string& filename)
{
CONSTRUCTOR_BEGIN;

Expand Down Expand Up @@ -201,9 +201,9 @@ Gosu::Sample::Sample(Reader reader)
WAVE_FILE audio_file(reader);
data.reset(new SampleData(audio_file));
}
catch (const std::runtime_error& ex) {
catch (const runtime_error& ex) {
#ifndef GOSU_IS_MAC
if (std::string(ex.what()).find("unknown format") != std::string::npos) {
if (string(ex.what()).find("unknown format") != string::npos) {
MPEGFile mpeg_file(reader);
data.reset(new SampleData(mpeg_file));
}
Expand All @@ -224,7 +224,7 @@ Gosu::SampleInstance Gosu::Sample::play(double volume, double speed, bool loopin
Gosu::SampleInstance Gosu::Sample::play_pan(double pan, double volume, double speed,
bool looping) const
{
std::pair<int, int> channel_and_token = al_channel_management->reserve_channel();
pair<int, int> channel_and_token = al_channel_management->reserve_channel();
if (channel_and_token.first == ALChannelManagement::NO_FREE_CHANNEL) {
return Gosu::SampleInstance(channel_and_token.first, channel_and_token.second);
}
Expand Down Expand Up @@ -286,7 +286,7 @@ class Gosu::Song::ModuleData : public BaseData
}

public:
ModuleData(const std::string& filename)
ModuleData(const string& filename)
{
NSURL* URL = [NSURL fileURLWithPath:[NSString stringWithUTF8String:filename.c_str()]];
player = [[AVAudioPlayer alloc] initWithContentsOfURL:URL error:nil];
Expand Down Expand Up @@ -331,7 +331,7 @@ class Gosu::Song::ModuleData : public BaseData
// AudioFile impl
class Gosu::Song::StreamData : public BaseData
{
std::unique_ptr<AudioFile> file;
unique_ptr<AudioFile> file;
ALuint buffers[2];

void apply_volume() override
Expand All @@ -355,7 +355,7 @@ class Gosu::Song::StreamData : public BaseData
static const unsigned BUFFER_SIZE = 4096 * 8;
#endif
char audio_data[BUFFER_SIZE];
std::size_t read_bytes = file->read_data(audio_data, BUFFER_SIZE);
size_t read_bytes = file->read_data(audio_data, BUFFER_SIZE);
if (read_bytes > 0) {
alBufferData(buffer, file->format(), audio_data,
static_cast<ALsizei>(read_bytes), file->sample_rate());
Expand All @@ -364,7 +364,7 @@ class Gosu::Song::StreamData : public BaseData
}

public:
StreamData(const std::string& filename)
StreamData(const string& filename)
{
if (is_ogg_file(filename)) {
Gosu::File source_file(filename);
Expand All @@ -374,9 +374,9 @@ class Gosu::Song::StreamData : public BaseData
try {
file.reset(new WAVE_FILE(filename));
}
catch (const std::runtime_error& ex) {
catch (const runtime_error& ex) {
#ifndef GOSU_IS_MAC
if (std::string(ex.what()).find("unknown format") != std::string::npos) {
if (string(ex.what()).find("unknown format") != string::npos) {
Gosu::File source_file(filename);
file.reset(new MPEGFile(source_file.front_reader()));
}
Expand All @@ -397,9 +397,9 @@ class Gosu::Song::StreamData : public BaseData
try {
file.reset(new WAVE_FILE(reader));
}
catch (const std::runtime_error& ex) {
catch (const runtime_error& ex) {
#ifndef GOSU_IS_MAC
if (std::string(ex.what()).find("unknown format") != std::string::npos) {
if (string(ex.what()).find("unknown format") != string::npos) {
file.reset(new MPEGFile(reader));
}
else
Expand Down Expand Up @@ -522,7 +522,7 @@ class Gosu::Song::StreamData : public BaseData
}
};

Gosu::Song::Song(const std::string& filename)
Gosu::Song::Song(const string& filename)
{
#ifdef GOSU_IS_IPHONE
if (has_extension(filename, ".mp3") ||
Expand Down

0 comments on commit 41a421e

Please sign in to comment.