spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit e22440a32f3504b6f4406facd5a07122fb8fc6b3
parent 98fd7c5be3353221a1e8cc0416fd7f7841f7c670
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Mon,  3 Sep 2012 10:53:25 -0700

Tidy

Diffstat:
Msrc/spek-platform.cc | 8++++----
Msrc/spek-platform.hh | 22+++++++++-------------
Msrc/spek-preferences.cc | 2+-
Msrc/spek-spectrogram.cc | 6+++---
Msrc/spek.cc | 4++--
5 files changed, 19 insertions(+), 23 deletions(-)

diff --git a/src/spek-platform.cc b/src/spek-platform.cc @@ -28,7 +28,7 @@ #include "spek-platform.hh" -void SpekPlatform::init() +void spek_platform_init() { #ifdef OS_OSX ProcessSerialNumber PSN; @@ -37,7 +37,7 @@ void SpekPlatform::init() #endif } -wxString SpekPlatform::config_path(const wxString& app_name) +wxString spek_platform_config_path(const wxString& app_name) { #ifdef OS_WIN wxFileName file_name(wxStandardPaths::Get().GetUserConfigDir(), wxEmptyString); @@ -51,7 +51,7 @@ wxString SpekPlatform::config_path(const wxString& app_name) return file_name.GetFullPath(); } -bool SpekPlatform::can_change_language() +bool spek_platform_can_change_language() { #ifdef OS_UNIX return false; @@ -60,7 +60,7 @@ bool SpekPlatform::can_change_language() #endif } -double SpekPlatform::font_scale() +double spek_platform_font_scale() { #ifdef OS_OSX return 1.3; diff --git a/src/spek-platform.hh b/src/spek-platform.hh @@ -21,21 +21,17 @@ #include <wx/string.h> -class SpekPlatform -{ -public: - // Platform-specific initialisation code. - static void init(); +// Platform-specific initialisation code. +void spek_platform_init(); - // Not quite XDG-compatible, but close enough. - static wxString config_path(const wxString& app_name); +// Not quite XDG-compatible, but close enough. +wxString spek_platform_config_path(const wxString& app_name); - // Setting non-default locale under GTK+ is tricky (see e.g. how FileZilla does it). We will - // just disable the language setting for GTK+ users and will always use the system locale. - static bool can_change_language(); +// Setting non-default locale under GTK+ is tricky (see e.g. how FileZilla does it). We will +// just disable the language setting for GTK+ users and will always use the system locale. +bool spek_platform_can_change_language(); - // Fonts are smaller on OSX. - static double font_scale(); -}; +// Fonts are smaller on OSX. +double spek_platform_font_scale(); #endif diff --git a/src/spek-preferences.cc b/src/spek-preferences.cc @@ -49,7 +49,7 @@ void SpekPreferences::init() SpekPreferences::SpekPreferences() : locale(NULL) { - wxString path = SpekPlatform::config_path(wxT("spek")); + wxString path = spek_platform_config_path(wxT("spek")); this->config = new wxFileConfig( wxEmptyString, wxEmptyString, diff --git a/src/spek-spectrogram.cc b/src/spek-spectrogram.cc @@ -173,16 +173,16 @@ void SpekSpectrogram::render(wxDC& dc) dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.SetTextForeground(wxColour(255, 255, 255)); wxFont normal_font = wxFont( - (int)round(9 * SpekPlatform::font_scale()), + (int)round(9 * spek_platform_font_scale()), wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL ); wxFont large_font = wxFont(normal_font); - large_font.SetPointSize((int)round(10 * SpekPlatform::font_scale())); + large_font.SetPointSize((int)round(10 * spek_platform_font_scale())); large_font.SetWeight(wxFONTWEIGHT_BOLD); wxFont small_font = wxFont(normal_font); - small_font.SetPointSize((int)round(8 * SpekPlatform::font_scale())); + small_font.SetPointSize((int)round(8 * spek_platform_font_scale())); dc.SetFont(normal_font); int normal_height = dc.GetTextExtent(wxT("dummy")).GetHeight(); dc.SetFont(large_font); diff --git a/src/spek.cc b/src/spek.cc @@ -50,9 +50,9 @@ bool Spek::OnInit() wxInitAllImageHandlers(); wxSocketBase::Initialize(); - SpekPlatform::init(); - SpekPreferences::get().init(); spek_audio_init(); + spek_platform_init(); + SpekPreferences::get().init(); static const wxCmdLineEntryDesc desc[] = {{ wxCMD_LINE_SWITCH,