3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2009 Christian Schoenebeck * |
* Copyright (C) 2005 - 2013 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
35 |
Mutex loaderMutex; |
Mutex loaderMutex; |
36 |
|
|
37 |
void InstrumentManager::LoadInstrumentInBackground(InstrumentManager::instrument_id_t ID, EngineChannel* pEngineChannel) { |
void InstrumentManager::LoadInstrumentInBackground(InstrumentManager::instrument_id_t ID, EngineChannel* pEngineChannel) { |
38 |
loaderMutex.Lock(); |
LockGuard lock(loaderMutex); |
39 |
thread.StartNewLoad(ID.FileName, ID.Index, pEngineChannel); |
thread.StartNewLoad(ID.FileName, ID.Index, pEngineChannel); |
|
loaderMutex.Unlock(); |
|
40 |
} |
} |
41 |
|
|
42 |
void InstrumentManager::SetModeInBackground(const instrument_id_t& ID, mode_t Mode) { |
void InstrumentManager::SetModeInBackground(const instrument_id_t& ID, mode_t Mode) { |
43 |
loaderMutex.Lock(); |
LockGuard lock(loaderMutex); |
44 |
thread.StartSettingMode(this, ID, Mode); |
thread.StartSettingMode(this, ID, Mode); |
|
loaderMutex.Unlock(); |
|
45 |
} |
} |
46 |
|
|
47 |
void InstrumentManager::StopBackgroundThread() { |
void InstrumentManager::StopBackgroundThread() { |