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

Commit

Permalink
v1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Flone-dnb committed Aug 14, 2019
1 parent df1dddb commit 575098c
Show file tree
Hide file tree
Showing 12 changed files with 402 additions and 101 deletions.
126 changes: 126 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,129 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Bloody Player uses FMOD, it's license shown below:

FMOD END USER LICENCE AGREEMENT
===============================

This FMOD End User Licence Agreement (EULA) is a legal agreement between you and
Firelight Technologies Pty Ltd (ACN 099 182 448) (us or we) and governs your use
of FMOD Studio and FMOD Engine software (FMOD).

1. GRANT OF LICENCE
This EULA grants you the right to use FMOD, in a software application (Product), for
personal (hobbyist), educational (students and teachers) or Non-Commercial use only,
subject to the following:
i) Non-Commercial use does not involve any form of monetisation, sponsorship
or promotion.
ii) FMOD is distributed as integrated into a Product only;
iii) FMOD is not distributed as part of any Commercial Product or service;
iv) FMOD is not distributed as part of a game engine or tool set;
v) FMOD is not used in any Commercial enterprise or for any Commercial
production or subcontracting, except for the purposes of Evaluation or
Development of a Commercial Product;
vi) Product includes attribution in accordance with Clause 3;

2. OTHER USE
For all Commercial use, and any Non Commercial use not permitted by this license, a
separate license is required. Refer to www.fmod.com/licensing for information.

3. CREDITS
All Products require an in game credit line which must include the words "FMOD" or
"FMOD Studio" (if applicable) and "Firelight Technologies Pty Ltd". Refer to
www.fmod.com/licensing for examples

4. INTELLECTUAL PROPERTY RIGHTS
a) We are and remain at all times the owner of FMOD (including all intellectual
property rights in or to the Software). For the avoidance of doubt, nothing in
this EULA may be deemed to grant or assign to you any proprietary or ownership
interest or intellectual property rights in or to FMOD other than the rights
licensed pursuant to clause 1.
b) You acknowledge and agree that you have no right, title or interest in and to the
intellectual property rights in FMOD.

5. SECURITY AND RISK
You are responsible for protecting FMOD and any related materials at all times from
unauthorised access, use or damage.

6. WARRANTY AND LIMITATION OF LIABILITY
a) FMOD is provided by us "as is" and, to the maximum extent permitted by law,
any express or implied warranties of any kind, including (but not limited to) all
implied warranties of merchantability and fitness for a particular purpose are
disclaimed.
b) In no event shall we (and our employees, contractors and subcontractors),
developers and contributors be liable for any direct, special, indirect or
consequential damages whatsoever resulting from loss of use of data or profits,
whether in an action of contract, negligence or other tortious conduct, arising
out of or in connection with the use or performance FMOD.

7. OGG VORBIS CODEC
a) FMOD uses the Ogg Vorbis codec.
b) (c) 2002, Xiph.Org Foundation
c) Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
i) Redistributions of source code must retain the above copyright notice, the
list of conditions and the following disclaimer.
ii) Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other material provided with the distribution.
iii) Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
d) THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

8. GOOGLE VR (GVR)
FMOD includes Google VR, licensed under the Apache Licence, Version 2.0 (the
Licence); you may not use this file except in compliance with the License.
You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

9. ANDROID PLATFORM CODE
Copyright (C) 2010 The Android Open Source Project All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

10. AUDIOGAMING AUDIOMOTORS DEMO CONTENT
AudioGaming AudioMotors Demo Engine.agp is provided for evaluation purposes
only and is not to be redistributed. To create your own engine content, you
will need AudioMotors V2 Pro. A trial version be found at
http://store.audiogaming.net/content/audiomotors-v2-pro-trial. For access to
the full version, contact [email protected].

2 changes: 1 addition & 1 deletion ide/BloodyPlayer.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.9.2, 2019-08-10T11:26:54. -->
<!-- Written by QtCreator 4.9.2, 2019-08-14T20:32:13. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/Controller/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ void Controller::moveUp(size_t iTrackIndex)
pAudioService->moveUp(iTrackIndex);
}

void Controller::openTracklist(std::wstring pathToTracklist, bool bClearCurrent)
{
pAudioService->openTracklist(pathToTracklist, bClearCurrent);
}

void Controller::saveTracklist(std::wstring pathToTracklist)
{
pAudioService->saveTracklist(pathToTracklist);
}

void Controller::setPan(float fPan)
{
pAudioService->setPan(fPan);
Expand Down
3 changes: 3 additions & 0 deletions src/Controller/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class Controller
void moveDown (size_t iTrackIndex);
void moveUp (size_t iTrackIndex);

void openTracklist(std::wstring pathToTracklist, bool bClearCurrent);
void saveTracklist(std::wstring pathToTracklist);

// FX
void setPan (float fPan);
void setPitch (float fPitch);
Expand Down
84 changes: 81 additions & 3 deletions src/Model/AudioService/audioservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//STL
#include <string>
#include <thread>
#include <fstream>
#include <iomanip>
#include <sstream>
#include <ctime>
Expand Down Expand Up @@ -269,7 +270,7 @@ void AudioService::addTracks(std::vector<wchar_t*> paths)
}


pMainWindow->showWaitWindow();
pMainWindow->showWaitWindow("Please wait.\nAdding tracks.");

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

if ( (tracks.size() > 0) && (bIsSomeTrackPlaying) )
{
// 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.
unsigned int posInMS = static_cast<unsigned int>(static_cast<size_t>(graphPos) * tracks[iCurrentlyPlayingTrackIndex]->getLengthInMS() / MAX_X_AXIS_VALUE);
// 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.
unsigned int posInMS = static_cast<unsigned int>(static_cast<unsigned long long>(graphPos) * tracks[iCurrentlyPlayingTrackIndex]->getLengthInMS() / MAX_X_AXIS_VALUE);
if ( tracks[iCurrentlyPlayingTrackIndex]->setPositionInMS( posInMS ) )
{
pMainWindow->clearGraph();
Expand Down Expand Up @@ -593,6 +594,9 @@ void AudioService::removeTrack(size_t iTrackIndex)

void AudioService::clearPlaylist()
{
mtxTracksVec.lock();


bMonitorTracks = false;

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

fCurrentVolume = DEFAULT_VOLUME;


mtxTracksVec.unlock();
}

void AudioService::saveTracklist(std::wstring pathToTracklist)
{
mtxTracksVec.lock();

pMainWindow->showWaitWindow("Saving...");

std::ofstream tracklistFile(pathToTracklist, std::ios::binary);

short iTrackCount = static_cast<short>(tracks.size());
tracklistFile.write(reinterpret_cast<char*>(&iTrackCount), 2);

for (size_t i = 0; i < tracks.size(); i++)
{
std::wstring trackPath( tracks[i]->getFilePath() );
short iPathSize = static_cast<short>(trackPath.size()) * 2;

// Write path size
tracklistFile.write(reinterpret_cast<char*>(&iPathSize), sizeof(iPathSize));

tracklistFile.write(reinterpret_cast<char*>( const_cast<wchar_t*>(trackPath.c_str()) ), iPathSize);
}

tracklistFile.close();

pMainWindow->hideWaitWindow();

mtxTracksVec.unlock();
}

void AudioService::openTracklist(std::wstring pathToTracklist, bool bClearCurrent)
{
if (bClearCurrent)
{
pMainWindow->clearCurrentPlaylist();
clearPlaylist();
}

std::ifstream tracklistFile(pathToTracklist, std::ios::binary);
if (tracklistFile.is_open())
{
mtxTracksVec.lock();

short iTrackPathSize = 0;
std::vector<wchar_t*> newTracks;

short iTrackCount = 0;
tracklistFile.read(reinterpret_cast<char*>(&iTrackCount), 2);

for (short i = 0; i < iTrackCount; i++)
{
tracklistFile.read(reinterpret_cast<char*>(&iTrackPathSize), 2);

wchar_t* pNewTrack = new wchar_t[static_cast<size_t>(iTrackPathSize + 2)];
memset(pNewTrack, 0, static_cast<size_t>(iTrackPathSize + 2));

tracklistFile.read(reinterpret_cast<char*>(pNewTrack), iTrackPathSize);
newTracks.push_back(pNewTrack);
}

tracklistFile.close();
mtxTracksVec.unlock();

std::thread addThread(&AudioService::addTracks, this, newTracks);
addThread.detach();
}
else
{
pMainWindow->showMessageBox(true, "Can't open file.");
}
}

void AudioService::setPan(float fPan)
Expand Down
4 changes: 4 additions & 0 deletions src/Model/AudioService/audioservice.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class AudioService
// Removes all tracks.
void clearPlaylist();

// Tracklist
void saveTracklist(std::wstring pathToTracklist);
void openTracklist(std::wstring pathToTracklist, bool bClearCurrent);

// FX
void setPan (float fPan);
void setPitch (float fPitch);
Expand Down
Loading

0 comments on commit 575098c

Please sign in to comment.