Skip to content
This repository was archived by the owner on May 11, 2022. It is now read-only.

Commit 575098c

Browse files
committed
v1.12
1 parent df1dddb commit 575098c

File tree

12 files changed

+402
-101
lines changed

12 files changed

+402
-101
lines changed

LICENSE

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,129 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22+
23+
24+
Bloody Player uses FMOD, it's license shown below:
25+
26+
FMOD END USER LICENCE AGREEMENT
27+
===============================
28+
29+
This FMOD End User Licence Agreement (EULA) is a legal agreement between you and
30+
Firelight Technologies Pty Ltd (ACN 099 182 448) (us or we) and governs your use
31+
of FMOD Studio and FMOD Engine software (FMOD).
32+
33+
1. GRANT OF LICENCE
34+
This EULA grants you the right to use FMOD, in a software application (Product), for
35+
personal (hobbyist), educational (students and teachers) or Non-Commercial use only,
36+
subject to the following:
37+
i) Non-Commercial use does not involve any form of monetisation, sponsorship
38+
or promotion.
39+
ii) FMOD is distributed as integrated into a Product only;
40+
iii) FMOD is not distributed as part of any Commercial Product or service;
41+
iv) FMOD is not distributed as part of a game engine or tool set;
42+
v) FMOD is not used in any Commercial enterprise or for any Commercial
43+
production or subcontracting, except for the purposes of Evaluation or
44+
Development of a Commercial Product;
45+
vi) Product includes attribution in accordance with Clause 3;
46+
47+
2. OTHER USE
48+
For all Commercial use, and any Non Commercial use not permitted by this license, a
49+
separate license is required. Refer to www.fmod.com/licensing for information.
50+
51+
3. CREDITS
52+
All Products require an in game credit line which must include the words "FMOD" or
53+
"FMOD Studio" (if applicable) and "Firelight Technologies Pty Ltd". Refer to
54+
www.fmod.com/licensing for examples
55+
56+
4. INTELLECTUAL PROPERTY RIGHTS
57+
a) We are and remain at all times the owner of FMOD (including all intellectual
58+
property rights in or to the Software). For the avoidance of doubt, nothing in
59+
this EULA may be deemed to grant or assign to you any proprietary or ownership
60+
interest or intellectual property rights in or to FMOD other than the rights
61+
licensed pursuant to clause 1.
62+
b) You acknowledge and agree that you have no right, title or interest in and to the
63+
intellectual property rights in FMOD.
64+
65+
5. SECURITY AND RISK
66+
You are responsible for protecting FMOD and any related materials at all times from
67+
unauthorised access, use or damage.
68+
69+
6. WARRANTY AND LIMITATION OF LIABILITY
70+
a) FMOD is provided by us "as is" and, to the maximum extent permitted by law,
71+
any express or implied warranties of any kind, including (but not limited to) all
72+
implied warranties of merchantability and fitness for a particular purpose are
73+
disclaimed.
74+
b) In no event shall we (and our employees, contractors and subcontractors),
75+
developers and contributors be liable for any direct, special, indirect or
76+
consequential damages whatsoever resulting from loss of use of data or profits,
77+
whether in an action of contract, negligence or other tortious conduct, arising
78+
out of or in connection with the use or performance FMOD.
79+
80+
7. OGG VORBIS CODEC
81+
a) FMOD uses the Ogg Vorbis codec.
82+
b) (c) 2002, Xiph.Org Foundation
83+
c) Redistribution and use in source and binary forms, with or without modification,
84+
are permitted provided that the following conditions are met:
85+
i) Redistributions of source code must retain the above copyright notice, the
86+
list of conditions and the following disclaimer.
87+
ii) Redistributions in binary form must reproduce the above copyright notice,
88+
this list of conditions and the following disclaimer in the documentation
89+
and/or other material provided with the distribution.
90+
iii) Neither the name of the Xiph.org Foundation nor the names of its
91+
contributors may be used to endorse or promote products derived from this
92+
software without specific prior written permission.
93+
d) THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
94+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
95+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
96+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
97+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
98+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
99+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
100+
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
101+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
102+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
103+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
104+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
105+
106+
8. GOOGLE VR (GVR)
107+
FMOD includes Google VR, licensed under the Apache Licence, Version 2.0 (the
108+
Licence); you may not use this file except in compliance with the License.
109+
You may obtain a copy of the License at:
110+
http://www.apache.org/licenses/LICENSE-2.0
111+
Unless required by applicable law or agreed to in writing, software distributed
112+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
113+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
114+
specific language governing permissions and limitations under the License.
115+
116+
9. ANDROID PLATFORM CODE
117+
Copyright (C) 2010 The Android Open Source Project All rights reserved.
118+
119+
Redistribution and use in source and binary forms, with or without modification, are
120+
permitted provided that the following conditions are met:
121+
* Redistributions of source code must retain the above copyright
122+
notice, this list of conditions and the following disclaimer.
123+
* Redistributions in binary form must reproduce the above copyright
124+
notice, this list of conditions and the following disclaimer in
125+
the documentation and/or other materials provided with the
126+
distribution.
127+
128+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
129+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
130+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
131+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
132+
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
133+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
134+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
135+
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
136+
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
137+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
138+
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
139+
SUCH DAMAGE.
140+
141+
10. AUDIOGAMING AUDIOMOTORS DEMO CONTENT
142+
AudioGaming AudioMotors Demo Engine.agp is provided for evaluation purposes
143+
only and is not to be redistributed. To create your own engine content, you
144+
will need AudioMotors V2 Pro. A trial version be found at
145+
http://store.audiogaming.net/content/audiomotors-v2-pro-trial. For access to
146+
the full version, contact sales@fmod.com.
147+

ide/BloodyPlayer.pro.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE QtCreatorProject>
3-
<!-- Written by QtCreator 4.9.2, 2019-08-10T11:26:54. -->
3+
<!-- Written by QtCreator 4.9.2, 2019-08-14T20:32:13. -->
44
<qtcreator>
55
<data>
66
<variable>EnvironmentId</variable>

screenshot.png

2.77 KB
Loading

src/Controller/controller.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ void Controller::moveUp(size_t iTrackIndex)
8383
pAudioService->moveUp(iTrackIndex);
8484
}
8585

86+
void Controller::openTracklist(std::wstring pathToTracklist, bool bClearCurrent)
87+
{
88+
pAudioService->openTracklist(pathToTracklist, bClearCurrent);
89+
}
90+
91+
void Controller::saveTracklist(std::wstring pathToTracklist)
92+
{
93+
pAudioService->saveTracklist(pathToTracklist);
94+
}
95+
8696
void Controller::setPan(float fPan)
8797
{
8898
pAudioService->setPan(fPan);

src/Controller/controller.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class Controller
3030
void moveDown (size_t iTrackIndex);
3131
void moveUp (size_t iTrackIndex);
3232

33+
void openTracklist(std::wstring pathToTracklist, bool bClearCurrent);
34+
void saveTracklist(std::wstring pathToTracklist);
35+
3336
// FX
3437
void setPan (float fPan);
3538
void setPitch (float fPitch);

src/Model/AudioService/audioservice.cpp

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//STL
44
#include <string>
55
#include <thread>
6+
#include <fstream>
67
#include <iomanip>
78
#include <sstream>
89
#include <ctime>
@@ -269,7 +270,7 @@ void AudioService::addTracks(std::vector<wchar_t*> paths)
269270
}
270271

271272

272-
pMainWindow->showWaitWindow();
273+
pMainWindow->showWaitWindow("Please wait.\nAdding tracks.");
273274

274275
// Get amount of CPU threads
275276
// In every CPU thread we will add tracks
@@ -423,8 +424,8 @@ void AudioService::setTrackPos(unsigned int graphPos)
423424

424425
if ( (tracks.size() > 0) && (bIsSomeTrackPlaying) )
425426
{
426-
// static_cast<size_t> because overflow may occur if the track is longer than 70 minutes, for example: graphPos = 800 and track length is 110 minutes.
427-
unsigned int posInMS = static_cast<unsigned int>(static_cast<size_t>(graphPos) * tracks[iCurrentlyPlayingTrackIndex]->getLengthInMS() / MAX_X_AXIS_VALUE);
427+
// static_cast<unsigned long long> because overflow may occur if the track is longer than 70 minutes, for example: graphPos = 800 and track length is 110 minutes.
428+
unsigned int posInMS = static_cast<unsigned int>(static_cast<unsigned long long>(graphPos) * tracks[iCurrentlyPlayingTrackIndex]->getLengthInMS() / MAX_X_AXIS_VALUE);
428429
if ( tracks[iCurrentlyPlayingTrackIndex]->setPositionInMS( posInMS ) )
429430
{
430431
pMainWindow->clearGraph();
@@ -593,6 +594,9 @@ void AudioService::removeTrack(size_t iTrackIndex)
593594

594595
void AudioService::clearPlaylist()
595596
{
597+
mtxTracksVec.lock();
598+
599+
596600
bMonitorTracks = false;
597601

598602
std::this_thread::sleep_for(std::chrono::milliseconds(MONITOR_TRACK_INTERVAL_MS));
@@ -607,6 +611,80 @@ void AudioService::clearPlaylist()
607611
tracks.clear();
608612

609613
fCurrentVolume = DEFAULT_VOLUME;
614+
615+
616+
mtxTracksVec.unlock();
617+
}
618+
619+
void AudioService::saveTracklist(std::wstring pathToTracklist)
620+
{
621+
mtxTracksVec.lock();
622+
623+
pMainWindow->showWaitWindow("Saving...");
624+
625+
std::ofstream tracklistFile(pathToTracklist, std::ios::binary);
626+
627+
short iTrackCount = static_cast<short>(tracks.size());
628+
tracklistFile.write(reinterpret_cast<char*>(&iTrackCount), 2);
629+
630+
for (size_t i = 0; i < tracks.size(); i++)
631+
{
632+
std::wstring trackPath( tracks[i]->getFilePath() );
633+
short iPathSize = static_cast<short>(trackPath.size()) * 2;
634+
635+
// Write path size
636+
tracklistFile.write(reinterpret_cast<char*>(&iPathSize), sizeof(iPathSize));
637+
638+
tracklistFile.write(reinterpret_cast<char*>( const_cast<wchar_t*>(trackPath.c_str()) ), iPathSize);
639+
}
640+
641+
tracklistFile.close();
642+
643+
pMainWindow->hideWaitWindow();
644+
645+
mtxTracksVec.unlock();
646+
}
647+
648+
void AudioService::openTracklist(std::wstring pathToTracklist, bool bClearCurrent)
649+
{
650+
if (bClearCurrent)
651+
{
652+
pMainWindow->clearCurrentPlaylist();
653+
clearPlaylist();
654+
}
655+
656+
std::ifstream tracklistFile(pathToTracklist, std::ios::binary);
657+
if (tracklistFile.is_open())
658+
{
659+
mtxTracksVec.lock();
660+
661+
short iTrackPathSize = 0;
662+
std::vector<wchar_t*> newTracks;
663+
664+
short iTrackCount = 0;
665+
tracklistFile.read(reinterpret_cast<char*>(&iTrackCount), 2);
666+
667+
for (short i = 0; i < iTrackCount; i++)
668+
{
669+
tracklistFile.read(reinterpret_cast<char*>(&iTrackPathSize), 2);
670+
671+
wchar_t* pNewTrack = new wchar_t[static_cast<size_t>(iTrackPathSize + 2)];
672+
memset(pNewTrack, 0, static_cast<size_t>(iTrackPathSize + 2));
673+
674+
tracklistFile.read(reinterpret_cast<char*>(pNewTrack), iTrackPathSize);
675+
newTracks.push_back(pNewTrack);
676+
}
677+
678+
tracklistFile.close();
679+
mtxTracksVec.unlock();
680+
681+
std::thread addThread(&AudioService::addTracks, this, newTracks);
682+
addThread.detach();
683+
}
684+
else
685+
{
686+
pMainWindow->showMessageBox(true, "Can't open file.");
687+
}
610688
}
611689

612690
void AudioService::setPan(float fPan)

src/Model/AudioService/audioservice.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ class AudioService
6666
// Removes all tracks.
6767
void clearPlaylist();
6868

69+
// Tracklist
70+
void saveTracklist(std::wstring pathToTracklist);
71+
void openTracklist(std::wstring pathToTracklist, bool bClearCurrent);
72+
6973
// FX
7074
void setPan (float fPan);
7175
void setPitch (float fPitch);

0 commit comments

Comments
 (0)