forked from organicmaps/organicmaps
Setting length units for TTS in core. Removing unnecessary cpp getters.
This commit is contained in:
parent
cc846ea6f0
commit
6d911ac640
5 changed files with 8 additions and 24 deletions
|
@ -65,7 +65,7 @@ public class TTSPlayer
|
|||
|
||||
final Locale loc = getLocale();
|
||||
if (loc != null)
|
||||
;// Call native method to set locale for TTS (loc.getLanguage())
|
||||
nativeSetTurnNotificationsLocale(loc.getLanguage());
|
||||
}
|
||||
|
||||
private Locale getLocale()
|
||||
|
@ -103,15 +103,8 @@ public class TTSPlayer
|
|||
nativeEnableTurnNotifications(enabled);
|
||||
}
|
||||
|
||||
public void setLengthUnits(int units)
|
||||
{
|
||||
// Call native method to set units for TTS
|
||||
}
|
||||
|
||||
public native static void nativeEnableTurnNotifications(boolean enable);
|
||||
public native static boolean nativeAreTurnNotificationsEnabled();
|
||||
public native static void nativeSetTurnNotificationsLocale(String locale);
|
||||
public native static String nativeGetTurnNotificationsLocale();
|
||||
public native static void nativeSetTurnNotificationsUnits(int lengthUnits);
|
||||
public native static int nativeGetTurnNotificationsUnits();
|
||||
}
|
||||
|
|
|
@ -1616,6 +1616,13 @@ MapStyle Framework::GetMapStyle() const
|
|||
|
||||
void Framework::SetupMeasurementSystem()
|
||||
{
|
||||
Settings::Units units = Settings::Metric;
|
||||
Settings::Get("Units", units);
|
||||
LOG(LDEBUG, ("Units =", units));
|
||||
m_routingSession.SetTurnNotificationsUnits(units == Settings::Foot ?
|
||||
routing::turns::sound::LengthUnits::Feet :
|
||||
routing::turns::sound::LengthUnits::Meters);
|
||||
|
||||
m_informationDisplay.measurementSystemChanged();
|
||||
Invalidate();
|
||||
}
|
||||
|
|
|
@ -582,14 +582,6 @@ public:
|
|||
// Sound notifications for turn instructions.
|
||||
inline void EnableTurnNotifications(bool enable) { m_routingSession.EnableTurnNotifications(enable); }
|
||||
inline bool AreTurnNotificationsEnabled() const { return m_routingSession.AreTurnNotificationsEnabled(); }
|
||||
inline void SetTurnNotificationsUnits(routing::turns::sound::LengthUnits const & units)
|
||||
{
|
||||
m_routingSession.SetTurnNotificationsUnits(units);
|
||||
}
|
||||
inline routing::turns::sound::LengthUnits GetTurnNotificationsUnits() const
|
||||
{
|
||||
return m_routingSession.GetTurnNotificationsUnits();
|
||||
}
|
||||
inline void SetTurnNotificationsLocale(string const & locale) { m_routingSession.SetTurnNotificationsLocale(locale); }
|
||||
inline string GetTurnNotificationsLocale() const { return m_routingSession.GetTurnNotificationsLocale(); }
|
||||
|
||||
|
|
|
@ -310,13 +310,6 @@ void RoutingSession::SetTurnNotificationsUnits(routing::turns::sound::LengthUnit
|
|||
m_turnsSound.SetLengthUnits(units);
|
||||
}
|
||||
|
||||
routing::turns::sound::LengthUnits RoutingSession::GetTurnNotificationsUnits() const
|
||||
{
|
||||
threads::MutexGuard guard(m_routeSessionMutex);
|
||||
UNUSED_VALUE(guard);
|
||||
return m_turnsSound.GetLengthUnits();
|
||||
}
|
||||
|
||||
void RoutingSession::SetTurnNotificationsLocale(string const & locale)
|
||||
{
|
||||
threads::MutexGuard guard(m_routeSessionMutex);
|
||||
|
|
|
@ -92,7 +92,6 @@ public:
|
|||
void EnableTurnNotifications(bool enable);
|
||||
bool AreTurnNotificationsEnabled() const;
|
||||
void SetTurnNotificationsUnits(routing::turns::sound::LengthUnits const & units);
|
||||
routing::turns::sound::LengthUnits GetTurnNotificationsUnits() const;
|
||||
void SetTurnNotificationsLocale(string const & locale);
|
||||
string GetTurnNotificationsLocale() const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue