From 9626a95a53794044da8044ba93d3be9aea165128 Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:04:16 +0000 Subject: [PATCH 01/37] Create config.cpp --- addons/music/config.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 addons/music/config.cpp diff --git a/addons/music/config.cpp b/addons/music/config.cpp new file mode 100644 index 000000000..5444ceef8 --- /dev/null +++ b/addons/music/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + author = "$STR_CBA_Author"; + name = CSTRING(component); + url = "$STR_CBA_URL"; + units[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"CBA_common"}; + version = VERSION; + authors[] = {"Fishy"}; + }; +}; + +#include "CfgFunctions.hpp" +#include "CfgMusic.hpp" From c1967a7ae587dcddc0865694f7a3d506769df116 Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:07:31 +0000 Subject: [PATCH 02/37] Create CfgMusic.hpp --- addons/music/CfgMusic.hpp | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 addons/music/CfgMusic.hpp diff --git a/addons/music/CfgMusic.hpp b/addons/music/CfgMusic.hpp new file mode 100644 index 000000000..997a87c88 --- /dev/null +++ b/addons/music/CfgMusic.hpp @@ -0,0 +1,6 @@ +class CfgMusic +{ + + + +}; From 0bd367b7dee6d22aca5ed296cbd5c07420e762a0 Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:09:32 +0000 Subject: [PATCH 03/37] Create CfgFunctions.hpp --- addons/music/CfgFunctions.hpp | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 addons/music/CfgFunctions.hpp diff --git a/addons/music/CfgFunctions.hpp b/addons/music/CfgFunctions.hpp new file mode 100644 index 000000000..bcd2b7617 --- /dev/null +++ b/addons/music/CfgFunctions.hpp @@ -0,0 +1,51 @@ +class CfgFunctions +{ + class CBA + { + class Music + { + // FSH_fnc_getMusicPath + class getMusicPath + { + description = "Get the config path of given music class"; + file = "\x\cba\addons\music\fnc_getMusicPath.sqf"; + }; + // FSH_fnc_getMusicData + class getMusicData + { + description = "Get data attached to music class"; + file = "\x\cba\addons\music\fnc_getMusicData.sqf"; + }; + // FSH_fnc_searchMusic + class searchMusic + { + description = "Find music of spesified type"; + file = "\x\cba\addons\music\fnc_searchMusic.sqf"; + }; + // FSH_fnc_compileMusic + class compileMusic + { + description = "Find all music in game"; + file = "\x\cba\addons\music\fnc_compileMusic.sqf"; + }; + // FSH_fnc_getMusicPlaying + class getMusicPlaying + { + description = "returns the data on currently playing music"; + file = "\x\cba\addons\music\fnc_getMusicPlaying.sqf"; + }; + // FSH_fnc_playMusic + class playMusic + { + description = "Duh"; + file = "\x\cba\addons\music\fnc_playMusic.sqf"; + }; + // FSH_fnc_stopMusic + class stopMusic + { + description = "Duh"; + file = "\x\cba\addons\music\fnc_stopMusic.sqf"; + }; + }; + }; +}; From 410492c533ae82449c008c7c314080cb740ff26d Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:10:21 +0000 Subject: [PATCH 04/37] Create script_component.hpp --- addons/music/script_component.hpp | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 addons/music/script_component.hpp diff --git a/addons/music/script_component.hpp b/addons/music/script_component.hpp new file mode 100644 index 000000000..759d05cee --- /dev/null +++ b/addons/music/script_component.hpp @@ -0,0 +1,7 @@ +#define COMPONENT music +#include "\fsh_main\script_mod.hpp" + + +#define DEBUG_MODE_FULL +#define DEFAULT_SONG_TYPE "song" +#include "\x\cba\addons\main\script_macros.hpp" From 9ab739b1f2aaf3b48d1e337d8b1b09f1964fc64e Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:11:24 +0000 Subject: [PATCH 05/37] Create fnc_compileMusic.sqf --- addons/music/fnc_compileMusic.sqf | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 addons/music/fnc_compileMusic.sqf diff --git a/addons/music/fnc_compileMusic.sqf b/addons/music/fnc_compileMusic.sqf new file mode 100644 index 000000000..9d820c9ee --- /dev/null +++ b/addons/music/fnc_compileMusic.sqf @@ -0,0 +1,40 @@ +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_compileMusic +Description: + A function used to gather a list of all usable music. +Parameters: + none +Example: + (begin example) + _allmusic = [] call CBA_fnc_compileMusic + (end example) +Returns: + config +Author: + Fishy +---------------------------------------------------------------------------- */ +#include "script_component.hpp" +if (isNil QGVARMAIN(compiledMusic)) then { + _cfg = configFile >> 'CfgMusic'; + _mission_cfg = missionConfigFile >> 'CfgMusic'; + _songs_unsorted = []; + for [{_i=0}, {_i < (count _cfg)}, {INC(_i)}] do { + _song = _cfg select _i; + _s_dur = getNumber (_song >> 'duration'); + if (_s_dur !=0) then { + _song_cName = configName _song; + _songs_unsorted pushBack _song_cName; + }; + }; + for [{_i=0}, {_i < (count _mission_cfg)}, {INC(_i)}] do { + _song = _mission_cfg select _i; + _s_dur = getNumber (_song >> 'duration'); + if (_s_dur !=0) then { + _song_cName = configName _song; + _songs_unsorted pushBack _song_cName; + }; + }; + GVARMAIN(compiledMusic) = _songs_unsorted; + _songs_unsorted +}; +GVARMAIN(compiledMusic) From a67a6e0e76cf8df7b024662f5867cbccaac80d5d Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:12:07 +0000 Subject: [PATCH 06/37] Create fnc_getMusicData.sqf --- addons/music/fnc_getMusicData.sqf | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 addons/music/fnc_getMusicData.sqf diff --git a/addons/music/fnc_getMusicData.sqf b/addons/music/fnc_getMusicData.sqf new file mode 100644 index 000000000..6596822c9 --- /dev/null +++ b/addons/music/fnc_getMusicData.sqf @@ -0,0 +1,32 @@ +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_getMusicData +Description: + A function used to return data from the given music class +Parameters: + one string OR one config path, and a data type (eg 'name') +Example: + (begin example) + _musicName = ["LeadTrack01_F_Bootcamp","Duration"] call CBA_fnc_getMusicData; + (end example) +Returns: + String +Author: + Fishy +---------------------------------------------------------------------------- */ +#include "script_component.hpp" +private ["_cfg","_data"]; +params [["_className",''],["_dataType",'name']]; +LOG(_className); +if (typeName _className == 'STRING') then { + //Is a string, get config + _cfg = [_className] call CBA_fnc_getMusicPath; +} else { + if (IS_CONFIG(_className)) then { + _cfg = _className; + }; +}; +if (typeName _cfg != 'CONFIG') exitWith {ERROR_1('Config not found',_className);}; + +//Now we have a config, grab the data +_data = [_cfg,_dataType,nil] call BIS_fnc_returnConfigEntry; +_data From c35da7dd91aa74fc498e3bd66dcb4c8db15d4ccc Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:12:39 +0000 Subject: [PATCH 07/37] Create fnc_getMusicPath.sqf --- addons/music/fnc_getMusicPath.sqf | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 addons/music/fnc_getMusicPath.sqf diff --git a/addons/music/fnc_getMusicPath.sqf b/addons/music/fnc_getMusicPath.sqf new file mode 100644 index 000000000..99b3f645d --- /dev/null +++ b/addons/music/fnc_getMusicPath.sqf @@ -0,0 +1,28 @@ +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_getMusicPath +Description: + A function used to return the config path of a music file +Parameters: + one string +Example: + (begin example) + _configPath = ["LeadTrack01_F_Bootcamp"] call CBA_fnc_getMusicPath + (end example) +Returns: + config +Author: + Fishy +---------------------------------------------------------------------------- */ +#include "script_component.hpp" + +private ['_vars','_cfg','_dur']; +if (!params [["_className",'']]) exitWith {WARNING('No Class name given');}; +if (typeName _className != 'STRING') exitWith {WARNING_1('Class not a string',_className);}; +_cfg = configFile >> 'CfgMusic' >> _className; +_dur = getNumber (_cfg >> 'duration'); +if (_dur == 0) then { + _cfg = missionConfigFile >> 'CfgMusic' >> _className; + _dur = getNumber (_cfg >> 'name'); + if (_dur == 0) exitWith {WARNING_1('No path found for class',_className);nil}; +}; +_cfg From 3819c2b7922fb2e160150542390e4bedfe81d6a9 Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:13:27 +0000 Subject: [PATCH 08/37] Create fnc_getMusicPlaying --- addons/music/fnc_getMusicPlaying | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 addons/music/fnc_getMusicPlaying diff --git a/addons/music/fnc_getMusicPlaying b/addons/music/fnc_getMusicPlaying new file mode 100644 index 000000000..1c4e67ad2 --- /dev/null +++ b/addons/music/fnc_getMusicPlaying @@ -0,0 +1,37 @@ +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_getMusicPlaying +Description: + A function used to return the current time on playing music. Must have been started with CBA_fnc_playMusic +Parameters: + BOOL: if true, return bool (default: False) +Example: + (begin example) + _musicTime = [] call CBA_fnc_getMusicPlaying; + (end example) +Returns: + array [class, music time, time left] +Author: + Fishy +---------------------------------------------------------------------------- */ +#include "script_component.hpp" + +private ["_bool","_ret","_trackTime","_remaining"]; +_bool = [_this,0,false,[false]] call BIS_fnc_param; +_ret = ['', 0, 0, 0]; +if (isNil QGVAR(track)) exitWith { + if (_bool) then {_ret = false;}; + _ret +}; +if (_bool) exitWith {true}; + +GVAR(track) params ["_class","_startTime","_playPos","_duration"]; +_trackTime = (CBA_missionTime - _startTime) + _playPos; +_remaining = _duration - _trackTime; +if (_remaining <=0) then { + _remaining = 0; + _trackTime = 0; + _class = ""; + GVAR(track) = nil; +}; +_ret = [_class, _trackTime, _remaining]; +_ret From 06d55d2d5aed2f3f8b88106a73e26716438de601 Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:13:50 +0000 Subject: [PATCH 09/37] Rename fnc_getMusicPlaying to fnc_getMusicPlaying.sqf --- addons/music/{fnc_getMusicPlaying => fnc_getMusicPlaying.sqf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/music/{fnc_getMusicPlaying => fnc_getMusicPlaying.sqf} (100%) diff --git a/addons/music/fnc_getMusicPlaying b/addons/music/fnc_getMusicPlaying.sqf similarity index 100% rename from addons/music/fnc_getMusicPlaying rename to addons/music/fnc_getMusicPlaying.sqf From 097c336b2a67de33f4256c9eb968f1a1a1bc4cb7 Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:14:53 +0000 Subject: [PATCH 10/37] Create fnc_playMusic.sqf --- addons/music/fnc_playMusic.sqf | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 addons/music/fnc_playMusic.sqf diff --git a/addons/music/fnc_playMusic.sqf b/addons/music/fnc_playMusic.sqf new file mode 100644 index 000000000..7aea4cd97 --- /dev/null +++ b/addons/music/fnc_playMusic.sqf @@ -0,0 +1,48 @@ +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_playMusic +Description: + A function used to play music. +Parameters: + 1: CLASS Class to play + 2: INT Position to play from (default: 0) + 3: BOOL allowed to interupt already playing music (default: true) +Example: + (begin example) + _bool = ["LeadTrack01_F_Bootcamp", 30, true] call CBA_fnc_playMusic; + (end example) +Returns: + BOOL +Author: + Fishy +---------------------------------------------------------------------------- */ +#include "script_component.hpp" +private ["_cfg","_data","_canPlay","_duration","_ret"]; +params [["_className",""],["_time",'name'],["_overWrite", true]]; +if (_className == "") exitWith { + WARNING("No class given"); + false +}; + +_ret = false; +_canPlay = false; + +if (_overWrite) then { + _canPlay = true; +} else { + if (!([true] call CBA_fnc_getMusicPlaying)) then { + _canPlay = true; + }; +}; + +if (_canPlay) then { + _duration = [_className,'duration'] call CBA_fnc_getMusicData; + if (!isNil "_duration") then { + if (_time < _duration) then { + playMusic [_className, _time]; + GVAR(track) = [_className,CBA_missionTime,_time,_duration]; + _ret = true; + } else {WARNING("Time is greater than song length");}; + } else {WARNING("Music not found");}; +}; + +_ret From 25c8fef6aec660161dbf8f8cb826c2fb0b094c19 Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:15:36 +0000 Subject: [PATCH 11/37] Create fnc_searchMusic.sqf --- addons/music/fnc_searchMusic.sqf | 78 ++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 addons/music/fnc_searchMusic.sqf diff --git a/addons/music/fnc_searchMusic.sqf b/addons/music/fnc_searchMusic.sqf new file mode 100644 index 000000000..392427ac1 --- /dev/null +++ b/addons/music/fnc_searchMusic.sqf @@ -0,0 +1,78 @@ +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_searchMusic +Description: + A function used to return sogns with given type and tags +Parameters: + 1: A string or array of strings, defining music "type". + 2: A string or array of strings, defining tags/themes to look for. + 3: Array (optional) of song classes to search. Uses full list by default +Example: + (begin example) + _results = ["song","stealth"] call CBA_fnc_searchMusic + (end example) +Returns: + array +Author: + Fishy +---------------------------------------------------------------------------- */ +#include "script_component.hpp" + +private ['_vars','_cfg','_dur']; +if (!params [["_className",'']]) exitWith {ERROR('No Class name given');}; + +_search_type = [_this,0,'any',['',[]]] call BIS_fnc_param; +_search_tags = [_this,1,'any',['',[]]] call BIS_fnc_param; +_search_tracks = [_this,2,[] call fsh_fnc_compileMusic,[[]]] call BIS_fnc_param; +if (typeName _search_type == 'STRING') then {_search_type = [_search_type];}; +if (typeName _search_tags == 'STRING') then {_search_tags = [_search_tags];}; +if (_search_type select 0 == 'any') then {_search_type = [];}; +if (_search_tags select 0 == 'any') then {_search_tags = [];}; + +for [{_i=0}, {_i < (count _search_type)}, {INC(_i)}] do { + _entry = _search_type select _i; + if (typeName _entry != 'STRING') then { + _search_type set [_i, '']; + } else { + _search_type set [_i, toLower (_entry)]; + }; +}; +for [{_i=0}, {_i < (count _search_tags)}, {INC(_i)}] do { + _entry = _search_tags select _i; + if (typeName _entry != 'STRING') then { + _search_tags set [_i, '']; + } else { + _search_tags set [_i, toLower (_entry)]; + }; +}; + +_search_type = _search_type - ['']; +_search_tags = _search_tags - ['']; +_results = []; + +{ + _track = _x; + _cfg = [_track] call CBA_fnc_getMusicPath; + if (typeName _cfg == 'CONFIG') then { + _type = getText (_cfg >> 'type'); + if (_type == '') then {_type = DEFAULT_SONG_TYPE}; + if ((toLower _type) in _search_type || count _search_type == 0) then { + if (count _search_tags > 0) then { + _tags = getArray (_cfg >> 'tags'); + _theme = getText (_cfg >> 'theme'); + _tags pushBack _theme; //BIS sounds dont have tags so use their theme instead + for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { + _tag = toLower (_tags select _i); + if (_tag in _search_tags || count _search_tags == 0) then { + _i = count _tags; + _results pushBack _track; + }; + }; + } else { + //No tags required so add it + _results pushBack _track; + }; + }; + }; +} forEach _search_tracks; + +_results From aaaeed6c09cb0c3cc2946a5341cc8294afe58be2 Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:16:16 +0000 Subject: [PATCH 12/37] Create fnc_stopMusic.sqf --- addons/music/fnc_stopMusic.sqf | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 addons/music/fnc_stopMusic.sqf diff --git a/addons/music/fnc_stopMusic.sqf b/addons/music/fnc_stopMusic.sqf new file mode 100644 index 000000000..fb4cdb31a --- /dev/null +++ b/addons/music/fnc_stopMusic.sqf @@ -0,0 +1,25 @@ +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_stopMusic +Description: + A function used to stop any music playing. Must have been started with CBA_fnc_playMusic, otherwise it is ignored. +Parameters: + none +Example: + (begin example) + _bool = call CBA_fnc_stopMusic; + (end example) +Returns: + BOOL: true if music was stopped, false if already stopped +Author: + Fishy +---------------------------------------------------------------------------- */ +#include "script_component.hpp" +private ['_ret']; +if (!([true] call CBA_fnc_getMusicPlaying)) exitWith { + //Nothing is playing, so no need to do anything + false +}; + +playMusic ['',0]; +GVAR(track) = nil; +true From 7aa2ddb84795eb00ddd82445b943aa0e9138793e Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:17:35 +0000 Subject: [PATCH 13/37] Update script_component.hpp --- addons/music/script_component.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/music/script_component.hpp b/addons/music/script_component.hpp index 759d05cee..e83938e10 100644 --- a/addons/music/script_component.hpp +++ b/addons/music/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT music -#include "\fsh_main\script_mod.hpp" +#include "\x\cba\addons\main\script_mod.hpp" #define DEBUG_MODE_FULL From e3b54471daac4e27d0c0ae1d6a449be8acd26949 Mon Sep 17 00:00:00 2001 From: fishykins Date: Wed, 22 Feb 2017 23:34:06 +0000 Subject: [PATCH 14/37] Update fnc_compileMusic.sqf --- addons/music/fnc_compileMusic.sqf | 56 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/addons/music/fnc_compileMusic.sqf b/addons/music/fnc_compileMusic.sqf index 9d820c9ee..8d6feb6b0 100644 --- a/addons/music/fnc_compileMusic.sqf +++ b/addons/music/fnc_compileMusic.sqf @@ -1,40 +1,40 @@ /* ---------------------------------------------------------------------------- Function: CBA_fnc_compileMusic Description: - A function used to gather a list of all usable music. +A function used to gather a list of all usable music. Parameters: - none +none Example: - (begin example) - _allmusic = [] call CBA_fnc_compileMusic - (end example) +(begin example) +_allmusic = [] call CBA_fnc_compileMusic +(end example) Returns: - config +config Author: - Fishy +Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" if (isNil QGVARMAIN(compiledMusic)) then { - _cfg = configFile >> 'CfgMusic'; - _mission_cfg = missionConfigFile >> 'CfgMusic'; - _songs_unsorted = []; - for [{_i=0}, {_i < (count _cfg)}, {INC(_i)}] do { - _song = _cfg select _i; - _s_dur = getNumber (_song >> 'duration'); - if (_s_dur !=0) then { - _song_cName = configName _song; - _songs_unsorted pushBack _song_cName; - }; - }; - for [{_i=0}, {_i < (count _mission_cfg)}, {INC(_i)}] do { - _song = _mission_cfg select _i; - _s_dur = getNumber (_song >> 'duration'); - if (_s_dur !=0) then { - _song_cName = configName _song; - _songs_unsorted pushBack _song_cName; - }; - }; - GVARMAIN(compiledMusic) = _songs_unsorted; - _songs_unsorted +_cfg = configFile >> 'CfgMusic'; +_mission_cfg = missionConfigFile >> 'CfgMusic'; +_songs_unsorted = []; +for [{_i=0}, {_i < (count _cfg)}, {INC(_i)}] do { +_song = _cfg select _i; +_s_dur = getNumber (_song >> 'duration'); +if (_s_dur !=0) then { +_song_cName = configName _song; +_songs_unsorted pushBack _song_cName; +}; +}; +for [{_i=0}, {_i < (count _mission_cfg)}, {INC(_i)}] do { +_song = _mission_cfg select _i; +_s_dur = getNumber (_song >> 'duration'); +if (_s_dur !=0) then { +_song_cName = configName _song; +_songs_unsorted pushBack _song_cName; +}; +}; +GVARMAIN(compiledMusic) = _songs_unsorted; +_songs_unsorted }; GVARMAIN(compiledMusic) From 3957e0196059400a946284ef1cbc0f224e9efcbd Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 08:47:31 +0000 Subject: [PATCH 15/37] Update config.cpp --- addons/music/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/music/config.cpp b/addons/music/config.cpp index 5444ceef8..de9477a5f 100644 --- a/addons/music/config.cpp +++ b/addons/music/config.cpp @@ -1,7 +1,7 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { + class ADDON { author = "$STR_CBA_Author"; name = CSTRING(component); url = "$STR_CBA_URL"; From 3c2b703dadc114bc2725793812a590743338b00b Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 08:50:20 +0000 Subject: [PATCH 16/37] Update CfgFunctions.hpp --- addons/music/CfgFunctions.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/music/CfgFunctions.hpp b/addons/music/CfgFunctions.hpp index bcd2b7617..5bd9e1df4 100644 --- a/addons/music/CfgFunctions.hpp +++ b/addons/music/CfgFunctions.hpp @@ -10,37 +10,37 @@ class CfgFunctions description = "Get the config path of given music class"; file = "\x\cba\addons\music\fnc_getMusicPath.sqf"; }; - // FSH_fnc_getMusicData + // FSH_fnc_getMusicData class getMusicData { description = "Get data attached to music class"; file = "\x\cba\addons\music\fnc_getMusicData.sqf"; }; - // FSH_fnc_searchMusic + // FSH_fnc_searchMusic class searchMusic { description = "Find music of spesified type"; file = "\x\cba\addons\music\fnc_searchMusic.sqf"; }; - // FSH_fnc_compileMusic + // FSH_fnc_compileMusic class compileMusic { description = "Find all music in game"; - file = "\x\cba\addons\music\fnc_compileMusic.sqf"; + file = "\x\cba\addons\music\fnc_compileMusic.sqf"; }; - // FSH_fnc_getMusicPlaying + // FSH_fnc_getMusicPlaying class getMusicPlaying { description = "returns the data on currently playing music"; file = "\x\cba\addons\music\fnc_getMusicPlaying.sqf"; }; - // FSH_fnc_playMusic + // FSH_fnc_playMusic class playMusic { description = "Duh"; file = "\x\cba\addons\music\fnc_playMusic.sqf"; }; - // FSH_fnc_stopMusic + // FSH_fnc_stopMusic class stopMusic { description = "Duh"; From 5ae06cdf3e34809796142c4090c5f471da914ad3 Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 08:51:52 +0000 Subject: [PATCH 17/37] Update fnc_getMusicData.sqf --- addons/music/fnc_getMusicData.sqf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/music/fnc_getMusicData.sqf b/addons/music/fnc_getMusicData.sqf index 6596822c9..64a2de36d 100644 --- a/addons/music/fnc_getMusicData.sqf +++ b/addons/music/fnc_getMusicData.sqf @@ -18,12 +18,12 @@ private ["_cfg","_data"]; params [["_className",''],["_dataType",'name']]; LOG(_className); if (typeName _className == 'STRING') then { - //Is a string, get config - _cfg = [_className] call CBA_fnc_getMusicPath; + //Is a string, get config + _cfg = [_className] call CBA_fnc_getMusicPath; } else { - if (IS_CONFIG(_className)) then { - _cfg = _className; - }; + if (IS_CONFIG(_className)) then { + _cfg = _className; + }; }; if (typeName _cfg != 'CONFIG') exitWith {ERROR_1('Config not found',_className);}; From e66ad5313e0432c896624b10fc86db64fc36e692 Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 08:53:04 +0000 Subject: [PATCH 18/37] Update fnc_getMusicPath.sqf --- addons/music/fnc_getMusicPath.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/music/fnc_getMusicPath.sqf b/addons/music/fnc_getMusicPath.sqf index 99b3f645d..76f179933 100644 --- a/addons/music/fnc_getMusicPath.sqf +++ b/addons/music/fnc_getMusicPath.sqf @@ -21,8 +21,8 @@ if (typeName _className != 'STRING') exitWith {WARNING_1('Class not a string',_c _cfg = configFile >> 'CfgMusic' >> _className; _dur = getNumber (_cfg >> 'duration'); if (_dur == 0) then { - _cfg = missionConfigFile >> 'CfgMusic' >> _className; - _dur = getNumber (_cfg >> 'name'); - if (_dur == 0) exitWith {WARNING_1('No path found for class',_className);nil}; + _cfg = missionConfigFile >> 'CfgMusic' >> _className; + _dur = getNumber (_cfg >> 'name'); + if (_dur == 0) exitWith {WARNING_1('No path found for class',_className);nil}; }; _cfg From fb596b6231d1f04a2a4b8d25b6ada2396de3a1e2 Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 08:54:18 +0000 Subject: [PATCH 19/37] Update fnc_getMusicPlaying.sqf --- addons/music/fnc_getMusicPlaying.sqf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/music/fnc_getMusicPlaying.sqf b/addons/music/fnc_getMusicPlaying.sqf index 1c4e67ad2..5d8d8a728 100644 --- a/addons/music/fnc_getMusicPlaying.sqf +++ b/addons/music/fnc_getMusicPlaying.sqf @@ -19,8 +19,8 @@ private ["_bool","_ret","_trackTime","_remaining"]; _bool = [_this,0,false,[false]] call BIS_fnc_param; _ret = ['', 0, 0, 0]; if (isNil QGVAR(track)) exitWith { - if (_bool) then {_ret = false;}; - _ret + if (_bool) then {_ret = false;}; + _ret }; if (_bool) exitWith {true}; @@ -28,10 +28,10 @@ GVAR(track) params ["_class","_startTime","_playPos","_duration"]; _trackTime = (CBA_missionTime - _startTime) + _playPos; _remaining = _duration - _trackTime; if (_remaining <=0) then { - _remaining = 0; - _trackTime = 0; - _class = ""; - GVAR(track) = nil; + _remaining = 0; + _trackTime = 0; + _class = ""; + GVAR(track) = nil; }; _ret = [_class, _trackTime, _remaining]; _ret From 9615d2b14325c8e9e309c03e8d9be7d25aaaa515 Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 08:55:53 +0000 Subject: [PATCH 20/37] Update fnc_playMusic.sqf --- addons/music/fnc_playMusic.sqf | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/music/fnc_playMusic.sqf b/addons/music/fnc_playMusic.sqf index 7aea4cd97..c14abec5e 100644 --- a/addons/music/fnc_playMusic.sqf +++ b/addons/music/fnc_playMusic.sqf @@ -4,8 +4,8 @@ Description: A function used to play music. Parameters: 1: CLASS Class to play - 2: INT Position to play from (default: 0) - 3: BOOL allowed to interupt already playing music (default: true) + 2: INT Position to play from (default: 0) + 3: BOOL allowed to interupt already playing music (default: true) Example: (begin example) _bool = ["LeadTrack01_F_Bootcamp", 30, true] call CBA_fnc_playMusic; @@ -19,30 +19,30 @@ Author: private ["_cfg","_data","_canPlay","_duration","_ret"]; params [["_className",""],["_time",'name'],["_overWrite", true]]; if (_className == "") exitWith { - WARNING("No class given"); - false + WARNING("No class given"); + false }; _ret = false; _canPlay = false; if (_overWrite) then { - _canPlay = true; + _canPlay = true; } else { - if (!([true] call CBA_fnc_getMusicPlaying)) then { - _canPlay = true; - }; + if (!([true] call CBA_fnc_getMusicPlaying)) then { + _canPlay = true; + }; }; if (_canPlay) then { - _duration = [_className,'duration'] call CBA_fnc_getMusicData; - if (!isNil "_duration") then { - if (_time < _duration) then { - playMusic [_className, _time]; - GVAR(track) = [_className,CBA_missionTime,_time,_duration]; - _ret = true; - } else {WARNING("Time is greater than song length");}; - } else {WARNING("Music not found");}; + _duration = [_className,'duration'] call CBA_fnc_getMusicData; + if (!isNil "_duration") then { + if (_time < _duration) then { + playMusic [_className, _time]; + GVAR(track) = [_className,CBA_missionTime,_time,_duration]; + _ret = true; + } else {WARNING("Time is greater than song length");}; + } else {WARNING("Music not found");}; }; _ret From 924d38c7648c45aa2117d2d729b2998d01399cc5 Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 08:59:00 +0000 Subject: [PATCH 21/37] Update fnc_searchMusic.sqf --- addons/music/fnc_searchMusic.sqf | 74 ++++++++++++++++---------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/addons/music/fnc_searchMusic.sqf b/addons/music/fnc_searchMusic.sqf index 392427ac1..904256279 100644 --- a/addons/music/fnc_searchMusic.sqf +++ b/addons/music/fnc_searchMusic.sqf @@ -4,8 +4,8 @@ Description: A function used to return sogns with given type and tags Parameters: 1: A string or array of strings, defining music "type". - 2: A string or array of strings, defining tags/themes to look for. - 3: Array (optional) of song classes to search. Uses full list by default + 2: A string or array of strings, defining tags/themes to look for. + 3: Array (optional) of song classes to search. Uses full list by default Example: (begin example) _results = ["song","stealth"] call CBA_fnc_searchMusic @@ -29,20 +29,20 @@ if (_search_type select 0 == 'any') then {_search_type = [];}; if (_search_tags select 0 == 'any') then {_search_tags = [];}; for [{_i=0}, {_i < (count _search_type)}, {INC(_i)}] do { - _entry = _search_type select _i; - if (typeName _entry != 'STRING') then { - _search_type set [_i, '']; - } else { - _search_type set [_i, toLower (_entry)]; - }; + _entry = _search_type select _i; + if (typeName _entry != 'STRING') then { + _search_type set [_i, '']; + } else { + _search_type set [_i, toLower (_entry)]; + }; }; for [{_i=0}, {_i < (count _search_tags)}, {INC(_i)}] do { - _entry = _search_tags select _i; - if (typeName _entry != 'STRING') then { - _search_tags set [_i, '']; - } else { - _search_tags set [_i, toLower (_entry)]; - }; + _entry = _search_tags select _i; + if (typeName _entry != 'STRING') then { + _search_tags set [_i, '']; + } else { + _search_tags set [_i, toLower (_entry)]; + }; }; _search_type = _search_type - ['']; @@ -50,29 +50,29 @@ _search_tags = _search_tags - ['']; _results = []; { - _track = _x; - _cfg = [_track] call CBA_fnc_getMusicPath; - if (typeName _cfg == 'CONFIG') then { - _type = getText (_cfg >> 'type'); - if (_type == '') then {_type = DEFAULT_SONG_TYPE}; - if ((toLower _type) in _search_type || count _search_type == 0) then { - if (count _search_tags > 0) then { - _tags = getArray (_cfg >> 'tags'); - _theme = getText (_cfg >> 'theme'); - _tags pushBack _theme; //BIS sounds dont have tags so use their theme instead - for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { - _tag = toLower (_tags select _i); - if (_tag in _search_tags || count _search_tags == 0) then { - _i = count _tags; - _results pushBack _track; - }; - }; - } else { - //No tags required so add it - _results pushBack _track; - }; - }; - }; + _track = _x; + _cfg = [_track] call CBA_fnc_getMusicPath; + if (typeName _cfg == 'CONFIG') then { + _type = getText (_cfg >> 'type'); + if (_type == '') then {_type = DEFAULT_SONG_TYPE}; + if ((toLower _type) in _search_type || count _search_type == 0) then { + if (count _search_tags > 0) then { + _tags = getArray (_cfg >> 'tags'); + _theme = getText (_cfg >> 'theme'); + _tags pushBack _theme; //BIS sounds dont have tags so use their theme instead + for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { + _tag = toLower (_tags select _i); + if (_tag in _search_tags || count _search_tags == 0) then { + _i = count _tags; + _results pushBack _track; + }; + }; + } else { + //No tags required so add it + _results pushBack _track; + }; + }; + }; } forEach _search_tracks; _results From 6258a15f21d5d406b8986ba05d4ff7c6597355c9 Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 08:59:37 +0000 Subject: [PATCH 22/37] Update fnc_stopMusic.sqf --- addons/music/fnc_stopMusic.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/music/fnc_stopMusic.sqf b/addons/music/fnc_stopMusic.sqf index fb4cdb31a..d7a536b4b 100644 --- a/addons/music/fnc_stopMusic.sqf +++ b/addons/music/fnc_stopMusic.sqf @@ -16,8 +16,8 @@ Author: #include "script_component.hpp" private ['_ret']; if (!([true] call CBA_fnc_getMusicPlaying)) exitWith { - //Nothing is playing, so no need to do anything - false + //Nothing is playing, so no need to do anything + false }; playMusic ['',0]; From e22e983feff5db5a67fe2f3c312cde355781cd5c Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 09:00:41 +0000 Subject: [PATCH 23/37] Update CfgFunctions.hpp --- addons/music/CfgFunctions.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/music/CfgFunctions.hpp b/addons/music/CfgFunctions.hpp index 5bd9e1df4..4e7b15f8a 100644 --- a/addons/music/CfgFunctions.hpp +++ b/addons/music/CfgFunctions.hpp @@ -34,7 +34,7 @@ class CfgFunctions description = "returns the data on currently playing music"; file = "\x\cba\addons\music\fnc_getMusicPlaying.sqf"; }; - // FSH_fnc_playMusic + // FSH_fnc_playMusic class playMusic { description = "Duh"; From befaa7db4971428dd628b79685749f377d6ad644 Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 09:03:56 +0000 Subject: [PATCH 24/37] Update fnc_searchMusic.sqf --- addons/music/fnc_searchMusic.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/music/fnc_searchMusic.sqf b/addons/music/fnc_searchMusic.sqf index 904256279..b2a4bc4d6 100644 --- a/addons/music/fnc_searchMusic.sqf +++ b/addons/music/fnc_searchMusic.sqf @@ -59,7 +59,7 @@ _results = []; if (count _search_tags > 0) then { _tags = getArray (_cfg >> 'tags'); _theme = getText (_cfg >> 'theme'); - _tags pushBack _theme; //BIS sounds dont have tags so use their theme instead + _tags pushBack _theme; //BIS sounds dont have tags so use their theme instead for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { _tag = toLower (_tags select _i); if (_tag in _search_tags || count _search_tags == 0) then { @@ -71,8 +71,8 @@ _results = []; //No tags required so add it _results pushBack _track; }; - }; - }; + } + }; } forEach _search_tracks; _results From 45bded6e9084a5a6336d5b8da2dfe1ae512ad361 Mon Sep 17 00:00:00 2001 From: fishykins Date: Thu, 23 Feb 2017 09:05:04 +0000 Subject: [PATCH 25/37] Update CfgMusic.hpp --- addons/music/CfgMusic.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/music/CfgMusic.hpp b/addons/music/CfgMusic.hpp index 997a87c88..2fbbef646 100644 --- a/addons/music/CfgMusic.hpp +++ b/addons/music/CfgMusic.hpp @@ -1,6 +1,3 @@ -class CfgMusic +class CfgMusic { - - - }; From 4bcec6c2f1adfa9e012723032351fefba95e5fed Mon Sep 17 00:00:00 2001 From: Fishy Date: Sun, 5 Mar 2017 20:24:24 +0000 Subject: [PATCH 26/37] Update fnc_searchMusic.sqf --- addons/music/fnc_searchMusic.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/music/fnc_searchMusic.sqf b/addons/music/fnc_searchMusic.sqf index b2a4bc4d6..3626a082d 100644 --- a/addons/music/fnc_searchMusic.sqf +++ b/addons/music/fnc_searchMusic.sqf @@ -22,7 +22,7 @@ if (!params [["_className",'']]) exitWith {ERROR('No Class name given');}; _search_type = [_this,0,'any',['',[]]] call BIS_fnc_param; _search_tags = [_this,1,'any',['',[]]] call BIS_fnc_param; -_search_tracks = [_this,2,[] call fsh_fnc_compileMusic,[[]]] call BIS_fnc_param; +_search_tracks = [_this,2,[] call CBA_fnc_compileMusic,[[]]] call BIS_fnc_param; if (typeName _search_type == 'STRING') then {_search_type = [_search_type];}; if (typeName _search_tags == 'STRING') then {_search_tags = [_search_tags];}; if (_search_type select 0 == 'any') then {_search_type = [];}; From f527625a508b42f8949d4ee30aea68edf763addc Mon Sep 17 00:00:00 2001 From: Fishy Date: Sun, 5 Mar 2017 20:55:57 +0000 Subject: [PATCH 27/37] Updated to camelCase --- addons/music/fnc_compileMusic.sqf | 34 +++++++++--------- addons/music/fnc_getMusicData.sqf | 10 +++--- addons/music/fnc_getMusicPath.sqf | 16 ++++----- addons/music/fnc_getMusicPlaying.sqf | 20 +++++------ addons/music/fnc_playMusic.sqf | 8 ++--- addons/music/fnc_searchMusic.sqf | 54 ++++++++++++++-------------- addons/music/fnc_stopMusic.sqf | 2 +- 7 files changed, 72 insertions(+), 72 deletions(-) diff --git a/addons/music/fnc_compileMusic.sqf b/addons/music/fnc_compileMusic.sqf index 8d6feb6b0..1d747875c 100644 --- a/addons/music/fnc_compileMusic.sqf +++ b/addons/music/fnc_compileMusic.sqf @@ -15,26 +15,26 @@ Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" if (isNil QGVARMAIN(compiledMusic)) then { -_cfg = configFile >> 'CfgMusic'; -_mission_cfg = missionConfigFile >> 'CfgMusic'; -_songs_unsorted = []; -for [{_i=0}, {_i < (count _cfg)}, {INC(_i)}] do { -_song = _cfg select _i; -_s_dur = getNumber (_song >> 'duration'); -if (_s_dur !=0) then { -_song_cName = configName _song; -_songs_unsorted pushBack _song_cName; +_config = configFile >> 'CfgMusic'; +_missionConfig = missionConfigFile >> 'CfgMusic'; +_unsortedSongs = []; +for [{_i=0}, {_i < (count _config)}, {INC(_i)}] do { +_song = _config select _i; +_songDuration = getNumber (_song >> 'duration'); +if (_songDuration !=0) then { +_songClassName = configName _song; +_unsortedSongs pushBack _songClassName; }; }; -for [{_i=0}, {_i < (count _mission_cfg)}, {INC(_i)}] do { -_song = _mission_cfg select _i; -_s_dur = getNumber (_song >> 'duration'); -if (_s_dur !=0) then { -_song_cName = configName _song; -_songs_unsorted pushBack _song_cName; +for [{_i=0}, {_i < (count _missionConfig)}, {INC(_i)}] do { +_song = _missionConfig select _i; +_songDuration = getNumber (_song >> 'duration'); +if (_songDuration !=0) then { +_songClassName = configName _song; +_unsortedSongs pushBack _songClassName; }; }; -GVARMAIN(compiledMusic) = _songs_unsorted; -_songs_unsorted +GVARMAIN(compiledMusic) = _unsortedSongs; +_unsortedSongs }; GVARMAIN(compiledMusic) diff --git a/addons/music/fnc_getMusicData.sqf b/addons/music/fnc_getMusicData.sqf index 64a2de36d..e7b43f54b 100644 --- a/addons/music/fnc_getMusicData.sqf +++ b/addons/music/fnc_getMusicData.sqf @@ -14,19 +14,19 @@ Author: Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ["_cfg","_data"]; +private ["_config","_data"]; params [["_className",''],["_dataType",'name']]; LOG(_className); if (typeName _className == 'STRING') then { //Is a string, get config - _cfg = [_className] call CBA_fnc_getMusicPath; + _config = [_className] call CBA_fnc_getMusicPath; } else { if (IS_CONFIG(_className)) then { - _cfg = _className; + _config = _className; }; }; -if (typeName _cfg != 'CONFIG') exitWith {ERROR_1('Config not found',_className);}; +if (typeName _config != 'CONFIG') exitWith {ERROR_1('Config not found',_className);}; //Now we have a config, grab the data -_data = [_cfg,_dataType,nil] call BIS_fnc_returnConfigEntry; +_data = [_config,_dataType,nil] call BIS_fnc_returnurnConfigEntry; _data diff --git a/addons/music/fnc_getMusicPath.sqf b/addons/music/fnc_getMusicPath.sqf index 76f179933..014dd4dda 100644 --- a/addons/music/fnc_getMusicPath.sqf +++ b/addons/music/fnc_getMusicPath.sqf @@ -15,14 +15,14 @@ Author: ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ['_vars','_cfg','_dur']; +private ['_vars','_config','_duration']; if (!params [["_className",'']]) exitWith {WARNING('No Class name given');}; if (typeName _className != 'STRING') exitWith {WARNING_1('Class not a string',_className);}; -_cfg = configFile >> 'CfgMusic' >> _className; -_dur = getNumber (_cfg >> 'duration'); -if (_dur == 0) then { - _cfg = missionConfigFile >> 'CfgMusic' >> _className; - _dur = getNumber (_cfg >> 'name'); - if (_dur == 0) exitWith {WARNING_1('No path found for class',_className);nil}; +_config = configFile >> 'CfgMusic' >> _className; +_duration = getNumber (_config >> 'duration'); +if (_duration == 0) then { + _config = missionConfigFile >> 'CfgMusic' >> _className; + _duration = getNumber (_config >> 'name'); + if (_duration == 0) exitWith {WARNING_1('No path found for class',_className);nil}; }; -_cfg +_config diff --git a/addons/music/fnc_getMusicPlaying.sqf b/addons/music/fnc_getMusicPlaying.sqf index 5d8d8a728..a3b7fab85 100644 --- a/addons/music/fnc_getMusicPlaying.sqf +++ b/addons/music/fnc_getMusicPlaying.sqf @@ -9,29 +9,29 @@ Example: _musicTime = [] call CBA_fnc_getMusicPlaying; (end example) Returns: - array [class, music time, time left] + array [class, music time, time left] OR bool (true for playing music) Author: Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ["_bool","_ret","_trackTime","_remaining"]; +private ["_bool","_return","_trackTime","_remainingTime"]; _bool = [_this,0,false,[false]] call BIS_fnc_param; -_ret = ['', 0, 0, 0]; +_return = ['', 0, 0, 0]; if (isNil QGVAR(track)) exitWith { - if (_bool) then {_ret = false;}; - _ret + if (_bool) then {_return = false;}; + _return }; if (_bool) exitWith {true}; GVAR(track) params ["_class","_startTime","_playPos","_duration"]; _trackTime = (CBA_missionTime - _startTime) + _playPos; -_remaining = _duration - _trackTime; -if (_remaining <=0) then { - _remaining = 0; +_remainingTime = _duration - _trackTime; +if (_remainingTime <=0) then { + _remainingTime = 0; _trackTime = 0; _class = ""; GVAR(track) = nil; }; -_ret = [_class, _trackTime, _remaining]; -_ret +_return = [_class, _trackTime, _remainingTime]; +_return diff --git a/addons/music/fnc_playMusic.sqf b/addons/music/fnc_playMusic.sqf index c14abec5e..dbf3e7f24 100644 --- a/addons/music/fnc_playMusic.sqf +++ b/addons/music/fnc_playMusic.sqf @@ -16,14 +16,14 @@ Author: Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ["_cfg","_data","_canPlay","_duration","_ret"]; +private ["_config","_data","_canPlay","_duration","_return"]; params [["_className",""],["_time",'name'],["_overWrite", true]]; if (_className == "") exitWith { WARNING("No class given"); false }; -_ret = false; +_return = false; _canPlay = false; if (_overWrite) then { @@ -40,9 +40,9 @@ if (_canPlay) then { if (_time < _duration) then { playMusic [_className, _time]; GVAR(track) = [_className,CBA_missionTime,_time,_duration]; - _ret = true; + _return = true; } else {WARNING("Time is greater than song length");}; } else {WARNING("Music not found");}; }; -_ret +_return diff --git a/addons/music/fnc_searchMusic.sqf b/addons/music/fnc_searchMusic.sqf index 3626a082d..e049a5e09 100644 --- a/addons/music/fnc_searchMusic.sqf +++ b/addons/music/fnc_searchMusic.sqf @@ -17,52 +17,52 @@ Author: ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ['_vars','_cfg','_dur']; +private ['_vars','_config','_duration']; if (!params [["_className",'']]) exitWith {ERROR('No Class name given');}; -_search_type = [_this,0,'any',['',[]]] call BIS_fnc_param; -_search_tags = [_this,1,'any',['',[]]] call BIS_fnc_param; -_search_tracks = [_this,2,[] call CBA_fnc_compileMusic,[[]]] call BIS_fnc_param; -if (typeName _search_type == 'STRING') then {_search_type = [_search_type];}; -if (typeName _search_tags == 'STRING') then {_search_tags = [_search_tags];}; -if (_search_type select 0 == 'any') then {_search_type = [];}; -if (_search_tags select 0 == 'any') then {_search_tags = [];}; +_searchType = [_this,0,'any',['',[]]] call BIS_fnc_param; +_searchTags = [_this,1,'any',['',[]]] call BIS_fnc_param; +_searchTracks = [_this,2,[] call CBA_fnc_compileMusic,[[]]] call BIS_fnc_param; +if (typeName _searchType == 'STRING') then {_searchType = [_searchType];}; +if (typeName _searchTags == 'STRING') then {_searchTags = [_searchTags];}; +if (_searchType select 0 == 'any') then {_searchType = [];}; +if (_searchTags select 0 == 'any') then {_searchTags = [];}; -for [{_i=0}, {_i < (count _search_type)}, {INC(_i)}] do { - _entry = _search_type select _i; +for [{_i=0}, {_i < (count _searchType)}, {INC(_i)}] do { + _entry = _searchType select _i; if (typeName _entry != 'STRING') then { - _search_type set [_i, '']; + _searchType set [_i, '']; } else { - _search_type set [_i, toLower (_entry)]; + _searchType set [_i, toLower (_entry)]; }; }; -for [{_i=0}, {_i < (count _search_tags)}, {INC(_i)}] do { - _entry = _search_tags select _i; +for [{_i=0}, {_i < (count _searchTags)}, {INC(_i)}] do { + _entry = _searchTags select _i; if (typeName _entry != 'STRING') then { - _search_tags set [_i, '']; + _searchTags set [_i, '']; } else { - _search_tags set [_i, toLower (_entry)]; + _searchTags set [_i, toLower (_entry)]; }; }; -_search_type = _search_type - ['']; -_search_tags = _search_tags - ['']; +_searchType = _searchType - ['']; +_searchTags = _searchTags - ['']; _results = []; { _track = _x; - _cfg = [_track] call CBA_fnc_getMusicPath; - if (typeName _cfg == 'CONFIG') then { - _type = getText (_cfg >> 'type'); + _config = [_track] call CBA_fnc_getMusicPath; + if (typeName _config == 'CONFIG') then { + _type = getText (_config >> 'type'); if (_type == '') then {_type = DEFAULT_SONG_TYPE}; - if ((toLower _type) in _search_type || count _search_type == 0) then { - if (count _search_tags > 0) then { - _tags = getArray (_cfg >> 'tags'); - _theme = getText (_cfg >> 'theme'); + if ((toLower _type) in _searchType || count _searchType == 0) then { + if (count _searchTags > 0) then { + _tags = getArray (_config >> 'tags'); + _theme = getText (_config >> 'theme'); _tags pushBack _theme; //BIS sounds dont have tags so use their theme instead for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { _tag = toLower (_tags select _i); - if (_tag in _search_tags || count _search_tags == 0) then { + if (_tag in _searchTags || count _searchTags == 0) then { _i = count _tags; _results pushBack _track; }; @@ -73,6 +73,6 @@ _results = []; }; } }; -} forEach _search_tracks; +} forEach _searchTracks; _results diff --git a/addons/music/fnc_stopMusic.sqf b/addons/music/fnc_stopMusic.sqf index d7a536b4b..e87c9c6ac 100644 --- a/addons/music/fnc_stopMusic.sqf +++ b/addons/music/fnc_stopMusic.sqf @@ -14,7 +14,7 @@ Author: Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ['_ret']; +private ['_return']; if (!([true] call CBA_fnc_getMusicPlaying)) exitWith { //Nothing is playing, so no need to do anything false From 75b2f0667ecc1f9de3e1b1b4e58f444bd960eef4 Mon Sep 17 00:00:00 2001 From: Fishy Date: Wed, 8 Mar 2017 22:38:31 +0000 Subject: [PATCH 28/37] Lots of formatting and edits --- addons/music/CfgFunctions.hpp | 24 ++++----- addons/music/fnc_compileMusic.sqf | 72 ++++++++++++++----------- addons/music/fnc_getMusicData.sqf | 26 ++++++---- addons/music/fnc_getMusicPath.sqf | 34 +++++++----- addons/music/fnc_getMusicPlaying.sqf | 29 +++++++---- addons/music/fnc_playMusic.sqf | 51 ++++++++++-------- addons/music/fnc_searchMusic.sqf | 78 ---------------------------- addons/music/fnc_stopMusic.sqf | 20 +++---- 8 files changed, 149 insertions(+), 185 deletions(-) delete mode 100644 addons/music/fnc_searchMusic.sqf diff --git a/addons/music/CfgFunctions.hpp b/addons/music/CfgFunctions.hpp index 4e7b15f8a..315cd8136 100644 --- a/addons/music/CfgFunctions.hpp +++ b/addons/music/CfgFunctions.hpp @@ -4,46 +4,46 @@ class CfgFunctions { class Music { - // FSH_fnc_getMusicPath + // CBA_fnc_getMusicPath class getMusicPath { description = "Get the config path of given music class"; file = "\x\cba\addons\music\fnc_getMusicPath.sqf"; }; - // FSH_fnc_getMusicData + // CBA_fnc_getMusicData class getMusicData { description = "Get data attached to music class"; file = "\x\cba\addons\music\fnc_getMusicData.sqf"; }; - // FSH_fnc_searchMusic - class searchMusic + // CBA_fnc_findMusic + class findMusic { description = "Find music of spesified type"; - file = "\x\cba\addons\music\fnc_searchMusic.sqf"; + file = "\x\cba\addons\music\fnc_findMusic.sqf"; }; - // FSH_fnc_compileMusic + // CBA_fnc_compileMusic class compileMusic { description = "Find all music in game"; file = "\x\cba\addons\music\fnc_compileMusic.sqf"; }; - // FSH_fnc_getMusicPlaying + // CBA_fnc_getMusicPlaying class getMusicPlaying { - description = "returns the data on currently playing music"; + description = "Returns the data on currently playing music"; file = "\x\cba\addons\music\fnc_getMusicPlaying.sqf"; }; - // FSH_fnc_playMusic + // CBA_fnc_playMusic class playMusic { - description = "Duh"; + description = "Play a given track"; file = "\x\cba\addons\music\fnc_playMusic.sqf"; }; - // FSH_fnc_stopMusic + // CBA_fnc_stopMusic class stopMusic { - description = "Duh"; + description = "Stops the music playing"; file = "\x\cba\addons\music\fnc_stopMusic.sqf"; }; }; diff --git a/addons/music/fnc_compileMusic.sqf b/addons/music/fnc_compileMusic.sqf index 1d747875c..bfee99a37 100644 --- a/addons/music/fnc_compileMusic.sqf +++ b/addons/music/fnc_compileMusic.sqf @@ -1,40 +1,54 @@ /* ---------------------------------------------------------------------------- Function: CBA_fnc_compileMusic + Description: -A function used to gather a list of all usable music. + A function used to gather a list of all usable music. + Parameters: -none -Example: -(begin example) -_allmusic = [] call CBA_fnc_compileMusic -(end example) + none + Returns: -config + Array of compiled music + +Example: + (begin example) + _allMusic = [] call CBA_fnc_compileMusic + (end example) + Author: -Fishy + Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" + if (isNil QGVARMAIN(compiledMusic)) then { -_config = configFile >> 'CfgMusic'; -_missionConfig = missionConfigFile >> 'CfgMusic'; -_unsortedSongs = []; -for [{_i=0}, {_i < (count _config)}, {INC(_i)}] do { -_song = _config select _i; -_songDuration = getNumber (_song >> 'duration'); -if (_songDuration !=0) then { -_songClassName = configName _song; -_unsortedSongs pushBack _songClassName; -}; -}; -for [{_i=0}, {_i < (count _missionConfig)}, {INC(_i)}] do { -_song = _missionConfig select _i; -_songDuration = getNumber (_song >> 'duration'); -if (_songDuration !=0) then { -_songClassName = configName _song; -_unsortedSongs pushBack _songClassName; -}; -}; -GVARMAIN(compiledMusic) = _unsortedSongs; -_unsortedSongs + private "_config"; + _config = configFile >> 'CfgMusic'; + private "_missionConfig"; + _missionConfig = missionConfigFile >> 'CfgMusic'; + private "_unsortedSongs"; + _unsortedSongs = []; + + for [{_i=0}, {_i < (count _config)}, {INC(_i)}] do { + private "_song"; + _song = _config select _i; + private "_songDuration"; + _songDuration = getNumber (_song >> 'duration'); + if (_songDuration > 0) then { + _unsortedSongs pushBack (configName _song); + }; + }; + + for [{_i=0}, {_i < (count _missionConfig)}, {INC(_i)}] do { + private "_song"; + _song = _missionConfig select _i; + private "_songDuration"; + _songDuration = getNumber (_song >> 'duration'); + if (_songDuration > 0) then { + _unsortedSongs pushBack (configName _song); + }; + }; + + GVARMAIN(compiledMusic) = _unsortedSongs; }; + GVARMAIN(compiledMusic) diff --git a/addons/music/fnc_getMusicData.sqf b/addons/music/fnc_getMusicData.sqf index e7b43f54b..1b453b050 100644 --- a/addons/music/fnc_getMusicData.sqf +++ b/addons/music/fnc_getMusicData.sqf @@ -1,23 +1,29 @@ /* ---------------------------------------------------------------------------- Function: CBA_fnc_getMusicData + Description: A function used to return data from the given music class + Parameters: one string OR one config path, and a data type (eg 'name') + +Returns: + data entry for requested music class + Example: (begin example) - _musicName = ["LeadTrack01_F_Bootcamp","Duration"] call CBA_fnc_getMusicData; + _musicName = ["LeadTrack01_F_Bootcamp","Duration"] call CBA_fnc_getMusicData; (end example) -Returns: - String + Author: Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ["_config","_data"]; -params [["_className",''],["_dataType",'name']]; -LOG(_className); -if (typeName _className == 'STRING') then { + +params [["_className",""],["_dataType","name"]]; +private "_config"; + +if (IS_STRING(_classname)) then { //Is a string, get config _config = [_className] call CBA_fnc_getMusicPath; } else { @@ -25,8 +31,8 @@ if (typeName _className == 'STRING') then { _config = _className; }; }; -if (typeName _config != 'CONFIG') exitWith {ERROR_1('Config not found',_className);}; + +if (!IS_CONFIG(_config)) exitWith {ERROR_1("Config not found",_className);}; //Now we have a config, grab the data -_data = [_config,_dataType,nil] call BIS_fnc_returnurnConfigEntry; -_data +[_config,_dataType,nil] call BIS_fnc_returnConfigEntry diff --git a/addons/music/fnc_getMusicPath.sqf b/addons/music/fnc_getMusicPath.sqf index 014dd4dda..5d3eafb31 100644 --- a/addons/music/fnc_getMusicPath.sqf +++ b/addons/music/fnc_getMusicPath.sqf @@ -1,28 +1,36 @@ /* ---------------------------------------------------------------------------- Function: CBA_fnc_getMusicPath + Description: A function used to return the config path of a music file + Parameters: - one string + STRING- name of track + +Returns: + config entry of given track + Example: (begin example) - _configPath = ["LeadTrack01_F_Bootcamp"] call CBA_fnc_getMusicPath + _configPath = ["LeadTrack01_F_Bootcamp"] call CBA_fnc_getMusicPath (end example) -Returns: - config -Author: - Fishy + +Authors: + Fishy, Dorbedo ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ['_vars','_config','_duration']; -if (!params [["_className",'']]) exitWith {WARNING('No Class name given');}; -if (typeName _className != 'STRING') exitWith {WARNING_1('Class not a string',_className);}; +if (!params [["_className","",[""]]]) exitWith {WARNING('No classname was provided');}; + +private "_config"; _config = configFile >> 'CfgMusic' >> _className; -_duration = getNumber (_config >> 'duration'); +private "_duration"; +_duration = getNumber (_config >> "duration"); + if (_duration == 0) then { - _config = missionConfigFile >> 'CfgMusic' >> _className; - _duration = getNumber (_config >> 'name'); - if (_duration == 0) exitWith {WARNING_1('No path found for class',_className);nil}; + _config = missionConfigFile >> "CfgMusic" >> _className; + _duration = getNumber (_config >> "name"); + if (_duration == 0) exitWith {WARNING_1("No path found for class",_className);nil}; }; + _config diff --git a/addons/music/fnc_getMusicPlaying.sqf b/addons/music/fnc_getMusicPlaying.sqf index a3b7fab85..ff4138a32 100644 --- a/addons/music/fnc_getMusicPlaying.sqf +++ b/addons/music/fnc_getMusicPlaying.sqf @@ -1,31 +1,37 @@ /* ---------------------------------------------------------------------------- Function: CBA_fnc_getMusicPlaying + Description: A function used to return the current time on playing music. Must have been started with CBA_fnc_playMusic + Parameters: - BOOL: if true, return bool (default: False) + BOOL: if true, return bool (default: false) + +Returns: + array [class, music time, time left] OR bool (true for playing music) + Example: (begin example) - _musicTime = [] call CBA_fnc_getMusicPlaying; + _musicTime = [] call CBA_fnc_getMusicPlaying; (end example) -Returns: - array [class, music time, time left] OR bool (true for playing music) + Author: Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ["_bool","_return","_trackTime","_remainingTime"]; -_bool = [_this,0,false,[false]] call BIS_fnc_param; -_return = ['', 0, 0, 0]; +if (!params [["_bool",false,[false]]]) exitWith {WARNING('Incorrect param');}; + if (isNil QGVAR(track)) exitWith { - if (_bool) then {_return = false;}; - _return + if (_bool) then {false} else {['', 0, 0, 0]} }; + if (_bool) exitWith {true}; GVAR(track) params ["_class","_startTime","_playPos","_duration"]; +private "_trackTime"; _trackTime = (CBA_missionTime - _startTime) + _playPos; +private "_remainingTime"; _remainingTime = _duration - _trackTime; if (_remainingTime <=0) then { _remainingTime = 0; @@ -33,5 +39,6 @@ if (_remainingTime <=0) then { _class = ""; GVAR(track) = nil; }; -_return = [_class, _trackTime, _remainingTime]; -_return + +[_class, _trackTime, _remainingTime] + diff --git a/addons/music/fnc_playMusic.sqf b/addons/music/fnc_playMusic.sqf index dbf3e7f24..790fd2218 100644 --- a/addons/music/fnc_playMusic.sqf +++ b/addons/music/fnc_playMusic.sqf @@ -1,48 +1,53 @@ /* ---------------------------------------------------------------------------- Function: CBA_fnc_playMusic + Description: A function used to play music. + Parameters: 1: CLASS Class to play 2: INT Position to play from (default: 0) 3: BOOL allowed to interupt already playing music (default: true) + +Returns: + BOOL -true if started playing music + Example: (begin example) - _bool = ["LeadTrack01_F_Bootcamp", 30, true] call CBA_fnc_playMusic; + _bool = ["LeadTrack01_F_Bootcamp", 30, true] call CBA_fnc_playMusic; (end example) -Returns: - BOOL + + Author: Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ["_config","_data","_canPlay","_duration","_return"]; -params [["_className",""],["_time",'name'],["_overWrite", true]]; -if (_className == "") exitWith { + +params [["_className","",[""]],["_time",0,[0]],["_overWrite", true,[true]]]; + +if (_className isEqualTo "") exitWith { WARNING("No class given"); false }; +If ((!_overWrite)&&{[true] call CBA_fnc_getMusicPlaying}) exitWith {false}; + +private "_return"; _return = false; -_canPlay = false; -if (_overWrite) then { - _canPlay = true; -} else { - if (!([true] call CBA_fnc_getMusicPlaying)) then { - _canPlay = true; - }; -}; +private "_duration"; +_duration = [_className,"duration"] call CBA_fnc_getMusicData; -if (_canPlay) then { - _duration = [_className,'duration'] call CBA_fnc_getMusicData; - if (!isNil "_duration") then { - if (_time < _duration) then { - playMusic [_className, _time]; - GVAR(track) = [_className,CBA_missionTime,_time,_duration]; - _return = true; - } else {WARNING("Time is greater than song length");}; - } else {WARNING("Music not found");}; +if (!isNil "_duration") then { + if (_time < _duration) then { + playMusic [_className, _time]; + GVAR(track) = [_className,CBA_missionTime,_time,_duration]; + _return = true; + } else { + WARNING("Time is greater than song length"); + }; +} else { + WARNING("Music not found"); }; _return diff --git a/addons/music/fnc_searchMusic.sqf b/addons/music/fnc_searchMusic.sqf deleted file mode 100644 index e049a5e09..000000000 --- a/addons/music/fnc_searchMusic.sqf +++ /dev/null @@ -1,78 +0,0 @@ -/* ---------------------------------------------------------------------------- -Function: CBA_fnc_searchMusic -Description: - A function used to return sogns with given type and tags -Parameters: - 1: A string or array of strings, defining music "type". - 2: A string or array of strings, defining tags/themes to look for. - 3: Array (optional) of song classes to search. Uses full list by default -Example: - (begin example) - _results = ["song","stealth"] call CBA_fnc_searchMusic - (end example) -Returns: - array -Author: - Fishy ----------------------------------------------------------------------------- */ -#include "script_component.hpp" - -private ['_vars','_config','_duration']; -if (!params [["_className",'']]) exitWith {ERROR('No Class name given');}; - -_searchType = [_this,0,'any',['',[]]] call BIS_fnc_param; -_searchTags = [_this,1,'any',['',[]]] call BIS_fnc_param; -_searchTracks = [_this,2,[] call CBA_fnc_compileMusic,[[]]] call BIS_fnc_param; -if (typeName _searchType == 'STRING') then {_searchType = [_searchType];}; -if (typeName _searchTags == 'STRING') then {_searchTags = [_searchTags];}; -if (_searchType select 0 == 'any') then {_searchType = [];}; -if (_searchTags select 0 == 'any') then {_searchTags = [];}; - -for [{_i=0}, {_i < (count _searchType)}, {INC(_i)}] do { - _entry = _searchType select _i; - if (typeName _entry != 'STRING') then { - _searchType set [_i, '']; - } else { - _searchType set [_i, toLower (_entry)]; - }; -}; -for [{_i=0}, {_i < (count _searchTags)}, {INC(_i)}] do { - _entry = _searchTags select _i; - if (typeName _entry != 'STRING') then { - _searchTags set [_i, '']; - } else { - _searchTags set [_i, toLower (_entry)]; - }; -}; - -_searchType = _searchType - ['']; -_searchTags = _searchTags - ['']; -_results = []; - -{ - _track = _x; - _config = [_track] call CBA_fnc_getMusicPath; - if (typeName _config == 'CONFIG') then { - _type = getText (_config >> 'type'); - if (_type == '') then {_type = DEFAULT_SONG_TYPE}; - if ((toLower _type) in _searchType || count _searchType == 0) then { - if (count _searchTags > 0) then { - _tags = getArray (_config >> 'tags'); - _theme = getText (_config >> 'theme'); - _tags pushBack _theme; //BIS sounds dont have tags so use their theme instead - for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { - _tag = toLower (_tags select _i); - if (_tag in _searchTags || count _searchTags == 0) then { - _i = count _tags; - _results pushBack _track; - }; - }; - } else { - //No tags required so add it - _results pushBack _track; - }; - } - }; -} forEach _searchTracks; - -_results diff --git a/addons/music/fnc_stopMusic.sqf b/addons/music/fnc_stopMusic.sqf index e87c9c6ac..2ba8f9d95 100644 --- a/addons/music/fnc_stopMusic.sqf +++ b/addons/music/fnc_stopMusic.sqf @@ -1,25 +1,27 @@ /* ---------------------------------------------------------------------------- Function: CBA_fnc_stopMusic + Description: A function used to stop any music playing. Must have been started with CBA_fnc_playMusic, otherwise it is ignored. + Parameters: none + +Returns: + BOOL: true if music was stopped, false if already stopped + Example: (begin example) - _bool = call CBA_fnc_stopMusic; + _bool = call CBA_fnc_stopMusic; (end example) -Returns: - BOOL: true if music was stopped, false if already stopped + Author: Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private ['_return']; -if (!([true] call CBA_fnc_getMusicPlaying)) exitWith { - //Nothing is playing, so no need to do anything - false -}; -playMusic ['',0]; +if (!([true] call CBA_fnc_getMusicPlaying)) exitWith {false}; + +playMusic ["",0]; GVAR(track) = nil; true From cf6bc98700a2133d836752652b211f249805a807 Mon Sep 17 00:00:00 2001 From: Fishy Date: Thu, 9 Mar 2017 10:12:56 +0000 Subject: [PATCH 29/37] Create fnc_findMusic.sqf --- addons/music/fnc_findMusic.sqf | 73 ++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 addons/music/fnc_findMusic.sqf diff --git a/addons/music/fnc_findMusic.sqf b/addons/music/fnc_findMusic.sqf new file mode 100644 index 000000000..45e33977e --- /dev/null +++ b/addons/music/fnc_findMusic.sqf @@ -0,0 +1,73 @@ +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_findMusic + +Description: + A function used to return songs with given type and tags + +Parameters: + 1: A string or array of strings, defining music "type". + 2: A string or array of strings, defining tags/themes to look for. + 3: Array (optional) of song classes to search. Uses full list by default + +Returns: + array or results + +Example: + (begin example) + _results = ["song","stealth"] call CBA_fnc_searchMusic + (end example) + +Author: + Fishy, Dedmen, Dorbedo +---------------------------------------------------------------------------- */ +#include "script_component.hpp" + + +params [["_searchType","any",["",[]]],["_searchTags","any",["",[]]],["_searchTracks",([] call CBA_fnc_compileMusic),[[]]]]; + +if (IS_STRING(_searchType)) then {_searchType = [_searchType];}; +if (IS_STRING(_searchTags)) then {_searchTags = [_searchTags];}; + +if (_searchType select 0 == "any") then {_searchType = [];}; +if (_searchTags select 0 == "any") then {_searchTags = [];}; + +_searchType = _searchType apply {If (IS_STRING(_x)) then {toLower _x}else{""};}; +_searchTags = _searchTags apply {If (IS_STRING(_x)) then {toLower _x}else{""};}; + +_searchType = _searchType - [""]; +_searchTags = _searchTags - [""]; + +private "_results"; +_results = []; + +{ + private "_track"; + _track = _x; + private "_config"; + _config = [_track] call CBA_fnc_getMusicPath; + if (IS_CONFIG(_config)) then { + private "_type"; + _type = getText (_config >> 'type'); + if (_type == "") then {_type = DEFAULT_SONG_TYPE}; + + if (count _searchType == 0 || {(toLower _type) in _searchType}) then { + if (count _searchTags > 0) then { + _tags = getArray (_config >> 'tags'); + _theme = getText (_config >> 'theme'); + _tags pushBack _theme; //BIS sounds dont have tags so use their theme instead + for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { + _tag = toLower (_tags select _i); + if (count _searchTags == 0 || {_tag in _searchTags}) then { + _i = count _tags; + _results pushBack _track; + }; + }; + } else { + //No tags required so add it + _results pushBack _track; + }; + } + }; +} forEach _searchTracks; + +_results From f0f5f71f63fb783668ae3a3c9222978df2f82acd Mon Sep 17 00:00:00 2001 From: Fishy Date: Thu, 9 Mar 2017 10:47:55 +0000 Subject: [PATCH 30/37] More fixes for the approval of the mob --- addons/music/CfgFunctions.hpp | 6 ++++++ addons/music/fnc_compileMusic.sqf | 31 +++++++++++----------------- addons/music/fnc_findMusic.sqf | 20 +++++++----------- addons/music/fnc_getMusicData.sqf | 2 +- addons/music/fnc_getMusicPath.sqf | 10 ++++----- addons/music/fnc_getMusicPlaying.sqf | 18 +++++++--------- addons/music/fnc_isMusicPlaying.sqf | 27 ++++++++++++++++++++++++ addons/music/fnc_playMusic.sqf | 6 ++---- addons/music/fnc_stopMusic.sqf | 2 -- 9 files changed, 67 insertions(+), 55 deletions(-) create mode 100644 addons/music/fnc_isMusicPlaying.sqf diff --git a/addons/music/CfgFunctions.hpp b/addons/music/CfgFunctions.hpp index 315cd8136..beeb24407 100644 --- a/addons/music/CfgFunctions.hpp +++ b/addons/music/CfgFunctions.hpp @@ -34,6 +34,12 @@ class CfgFunctions description = "Returns the data on currently playing music"; file = "\x\cba\addons\music\fnc_getMusicPlaying.sqf"; }; + // CBA_fnc_isMusicPlaying + class isMusicPlaying + { + description = "Returns if music is playing or not"; + file = "\x\cba\addons\music\fnc_isMusicPlaying.sqf"; + }; // CBA_fnc_playMusic class playMusic { diff --git a/addons/music/fnc_compileMusic.sqf b/addons/music/fnc_compileMusic.sqf index bfee99a37..03e702a75 100644 --- a/addons/music/fnc_compileMusic.sqf +++ b/addons/music/fnc_compileMusic.sqf @@ -16,37 +16,30 @@ Example: (end example) Author: - Fishy + Fishy, Dedmen ---------------------------------------------------------------------------- */ #include "script_component.hpp" if (isNil QGVARMAIN(compiledMusic)) then { - private "_config"; - _config = configFile >> 'CfgMusic'; - private "_missionConfig"; - _missionConfig = missionConfigFile >> 'CfgMusic'; - private "_unsortedSongs"; - _unsortedSongs = []; + private _config = configFile >> 'CfgMusic'; + private _missionConfig = missionConfigFile >> 'CfgMusic'; + private _unsortedSongs = []; - for [{_i=0}, {_i < (count _config)}, {INC(_i)}] do { - private "_song"; - _song = _config select _i; - private "_songDuration"; - _songDuration = getNumber (_song >> 'duration'); + { + private _song = _x; + private _songDuration = getNumber (_song >> 'duration'); if (_songDuration > 0) then { _unsortedSongs pushBack (configName _song); }; - }; + } forEach _config; - for [{_i=0}, {_i < (count _missionConfig)}, {INC(_i)}] do { - private "_song"; - _song = _missionConfig select _i; - private "_songDuration"; - _songDuration = getNumber (_song >> 'duration'); + { + private _song = _x; + private _songDuration = getNumber (_song >> 'duration'); if (_songDuration > 0) then { _unsortedSongs pushBack (configName _song); }; - }; + } forEach _missionConfig; GVARMAIN(compiledMusic) = _unsortedSongs; }; diff --git a/addons/music/fnc_findMusic.sqf b/addons/music/fnc_findMusic.sqf index 45e33977e..9164c1d12 100644 --- a/addons/music/fnc_findMusic.sqf +++ b/addons/music/fnc_findMusic.sqf @@ -31,29 +31,25 @@ if (IS_STRING(_searchTags)) then {_searchTags = [_searchTags];}; if (_searchType select 0 == "any") then {_searchType = [];}; if (_searchTags select 0 == "any") then {_searchTags = [];}; -_searchType = _searchType apply {If (IS_STRING(_x)) then {toLower _x}else{""};}; -_searchTags = _searchTags apply {If (IS_STRING(_x)) then {toLower _x}else{""};}; +_searchType = _searchType apply {If (IS_STRING(_x)) then {toLower _x} else {""};}; +_searchTags = _searchTags apply {If (IS_STRING(_x)) then {toLower _x} else {""};}; _searchType = _searchType - [""]; _searchTags = _searchTags - [""]; -private "_results"; -_results = []; +private _results = []; { - private "_track"; - _track = _x; - private "_config"; - _config = [_track] call CBA_fnc_getMusicPath; + private _track = _x; + private _config = [_track] call CBA_fnc_getMusicPath; if (IS_CONFIG(_config)) then { - private "_type"; - _type = getText (_config >> 'type'); + private _type = getText (_config >> 'type'); if (_type == "") then {_type = DEFAULT_SONG_TYPE}; if (count _searchType == 0 || {(toLower _type) in _searchType}) then { if (count _searchTags > 0) then { - _tags = getArray (_config >> 'tags'); - _theme = getText (_config >> 'theme'); + private _tags = getArray (_config >> 'tags'); + private _theme = getText (_config >> 'theme'); _tags pushBack _theme; //BIS sounds dont have tags so use their theme instead for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { _tag = toLower (_tags select _i); diff --git a/addons/music/fnc_getMusicData.sqf b/addons/music/fnc_getMusicData.sqf index 1b453b050..6e837dade 100644 --- a/addons/music/fnc_getMusicData.sqf +++ b/addons/music/fnc_getMusicData.sqf @@ -32,7 +32,7 @@ if (IS_STRING(_classname)) then { }; }; -if (!IS_CONFIG(_config)) exitWith {ERROR_1("Config not found",_className);}; +If ((isNil "_config")||{!IS_CONFIG(_config)}) exitWith {ERROR_1("Config not found",_className);}; //Now we have a config, grab the data [_config,_dataType,nil] call BIS_fnc_returnConfigEntry diff --git a/addons/music/fnc_getMusicPath.sqf b/addons/music/fnc_getMusicPath.sqf index 5d3eafb31..e34dec8ea 100644 --- a/addons/music/fnc_getMusicPath.sqf +++ b/addons/music/fnc_getMusicPath.sqf @@ -22,15 +22,13 @@ Authors: if (!params [["_className","",[""]]]) exitWith {WARNING('No classname was provided');}; -private "_config"; -_config = configFile >> 'CfgMusic' >> _className; -private "_duration"; -_duration = getNumber (_config >> "duration"); +private _config = configFile >> 'CfgMusic' >> _className; +private _duration = getNumber (_config >> "duration"); if (_duration == 0) then { _config = missionConfigFile >> "CfgMusic" >> _className; - _duration = getNumber (_config >> "name"); - if (_duration == 0) exitWith {WARNING_1("No path found for class",_className);nil}; + _duration = getNumber (_config >> "duration"); + if (_duration == 0) exitWith {WARNING_1("No path found for class",_className)}; }; _config diff --git a/addons/music/fnc_getMusicPlaying.sqf b/addons/music/fnc_getMusicPlaying.sqf index ff4138a32..34c36e431 100644 --- a/addons/music/fnc_getMusicPlaying.sqf +++ b/addons/music/fnc_getMusicPlaying.sqf @@ -5,10 +5,10 @@ Description: A function used to return the current time on playing music. Must have been started with CBA_fnc_playMusic Parameters: - BOOL: if true, return bool (default: false) + none Returns: - array [class, music time, time left] OR bool (true for playing music) + array [class, music time, time left] Example: (begin example) @@ -22,17 +22,13 @@ Author: if (!params [["_bool",false,[false]]]) exitWith {WARNING('Incorrect param');}; -if (isNil QGVAR(track)) exitWith { - if (_bool) then {false} else {['', 0, 0, 0]} -}; - -if (_bool) exitWith {true}; +if (isNil QGVAR(track)) exitWith {['', 0, 0, 0]}; GVAR(track) params ["_class","_startTime","_playPos","_duration"]; -private "_trackTime"; -_trackTime = (CBA_missionTime - _startTime) + _playPos; -private "_remainingTime"; -_remainingTime = _duration - _trackTime; + +private _trackTime = (CBA_missionTime - _startTime) + _playPos; +private _remainingTime = _duration - _trackTime; + if (_remainingTime <=0) then { _remainingTime = 0; _trackTime = 0; diff --git a/addons/music/fnc_isMusicPlaying.sqf b/addons/music/fnc_isMusicPlaying.sqf new file mode 100644 index 000000000..e874fa08c --- /dev/null +++ b/addons/music/fnc_isMusicPlaying.sqf @@ -0,0 +1,27 @@ +/* ---------------------------------------------------------------------------- +Function: CBA_fnc_isMusicPlaying + +Description: + A function used to return the current time on playing music. Must have been started with CBA_fnc_playMusic + +Parameters: + none + +Returns: + BOOL- true if music is playing + +Example: + (begin example) + _isPlaying = [] call CBA_fnc_isMusicPlaying; + (end example) + +Author: + Fishy +---------------------------------------------------------------------------- */ +#include "script_component.hpp" + + +if (isNil QGVAR(track)) exitWith {false}; + +true + diff --git a/addons/music/fnc_playMusic.sqf b/addons/music/fnc_playMusic.sqf index 790fd2218..241831923 100644 --- a/addons/music/fnc_playMusic.sqf +++ b/addons/music/fnc_playMusic.sqf @@ -32,11 +32,9 @@ if (_className isEqualTo "") exitWith { If ((!_overWrite)&&{[true] call CBA_fnc_getMusicPlaying}) exitWith {false}; -private "_return"; -_return = false; +private _return = false; -private "_duration"; -_duration = [_className,"duration"] call CBA_fnc_getMusicData; +private _duration = [_className,"duration"] call CBA_fnc_getMusicData; if (!isNil "_duration") then { if (_time < _duration) then { diff --git a/addons/music/fnc_stopMusic.sqf b/addons/music/fnc_stopMusic.sqf index 2ba8f9d95..8904ce901 100644 --- a/addons/music/fnc_stopMusic.sqf +++ b/addons/music/fnc_stopMusic.sqf @@ -20,8 +20,6 @@ Author: ---------------------------------------------------------------------------- */ #include "script_component.hpp" -if (!([true] call CBA_fnc_getMusicPlaying)) exitWith {false}; - playMusic ["",0]; GVAR(track) = nil; true From d437bebfe1c120e406cf2d3d95a6f6dc88a8c694 Mon Sep 17 00:00:00 2001 From: Fishy Date: Thu, 9 Mar 2017 10:58:09 +0000 Subject: [PATCH 31/37] "forEach" not working with configs for some unknown reason... --- addons/music/fnc_compileMusic.sqf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/music/fnc_compileMusic.sqf b/addons/music/fnc_compileMusic.sqf index 03e702a75..cc30084c4 100644 --- a/addons/music/fnc_compileMusic.sqf +++ b/addons/music/fnc_compileMusic.sqf @@ -25,21 +25,21 @@ if (isNil QGVARMAIN(compiledMusic)) then { private _missionConfig = missionConfigFile >> 'CfgMusic'; private _unsortedSongs = []; - { - private _song = _x; + for [{_i=0}, {_i < (count _config)}, {INC(_i)}] do { + private _song = _config select _i; private _songDuration = getNumber (_song >> 'duration'); if (_songDuration > 0) then { _unsortedSongs pushBack (configName _song); }; - } forEach _config; + }; - { - private _song = _x; + for [{_i=0}, {_i < (count _missionConfig)}, {INC(_i)}] do { + private _song = _missionConfig select _i; private _songDuration = getNumber (_song >> 'duration'); if (_songDuration > 0) then { _unsortedSongs pushBack (configName _song); }; - } forEach _missionConfig; + }; GVARMAIN(compiledMusic) = _unsortedSongs; }; From c4c2add64e54e3bda531289b80f939c486782ffa Mon Sep 17 00:00:00 2001 From: Fishy Date: Thu, 9 Mar 2017 22:11:11 +0000 Subject: [PATCH 32/37] Tweaked as per comments --- addons/music/CfgMusic.hpp | 579 ++++++++++++++++++++++++++- addons/music/config.cpp | 2 +- addons/music/fnc_compileMusic.sqf | 30 +- addons/music/fnc_findMusic.sqf | 23 +- addons/music/fnc_getMusicData.sqf | 22 +- addons/music/fnc_getMusicPath.sqf | 12 +- addons/music/fnc_getMusicPlaying.sqf | 6 +- addons/music/fnc_isMusicPlaying.sqf | 9 +- addons/music/fnc_playMusic.sqf | 21 +- addons/music/fnc_stopMusic.sqf | 9 +- 10 files changed, 637 insertions(+), 76 deletions(-) diff --git a/addons/music/CfgMusic.hpp b/addons/music/CfgMusic.hpp index 2fbbef646..5817cbed0 100644 --- a/addons/music/CfgMusic.hpp +++ b/addons/music/CfgMusic.hpp @@ -1,3 +1,580 @@ class CfgMusic { -}; + /* ---------------------------------------------- + a3\music_f + ---------------------------------------------- */ + class LeadTrack01_F + { + type = "soundtrack"; + theme = "safe"; + tags[] = {bis, lead}; + }; + class LeadTrack01a_F + { + type = "soundtrack"; + theme = "safe"; + tags[] = {bis, lead}; + }; + class LeadTrack01b_F + { + type = "soundtrack"; + theme = "safe"; + tags[] = {bis, lead}; + }; + class LeadTrack01c_F + { + type = "soundtrack"; + theme = "safe"; + tags[] = {bis, lead}; + }; + class LeadTrack02_F + { + type = "soundtrack"; + theme = "safe"; + tags[] = {bis, lead}; + }; + class LeadTrack03_F + { + type = "soundtrack"; + theme = "combat"; + tags[] = {bis, lead}; + + }; + class LeadTrack04_F + { + type = "soundtrack"; + theme = "combat"; + tags[] = {bis, lead, action}; + }; + class LeadTrack04a_F + { + type = "soundtrack"; + theme = "combat"; + tags[] = {bis, lead, action}; + }; + class LeadTrack05_F + { + type = "soundtrack"; + theme = "combat"; + tags[] = {bis, lead, action}; + }; + class LeadTrack06_F + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead}; + }; + class ambientTrack01_F + { + type = "ambient"; + theme = "stealth"; + tags[] = {bis}; + }; + class ambientTrack01a_F + { + type = "ambient"; + theme = "stealth"; + tags[] = {bis}; + }; + class ambientTrack01b_F + { + type = "ambient"; + theme = "stealth"; + tags[] = {bis}; + }; + class ambientTrack03_F + { + type = "ambient"; + theme = "safe"; + tags[] = {bis}; + }; + class ambientTrack04a_F + { + type = "ambient"; + theme = "stealth"; + tags[] = {bis}; + }; + class ambientTrack04_F + { + type = "ambient"; + theme = "stealth"; + tags[] = {bis}; + }; + class BackgroundTrack03_F + { + type = "soundtrack"; + theme = "combat"; + tags[] = {bis, background, action}; + }; + class BackgroundTrack01_F + { + type = "soundtrack"; + theme = "safe"; + tags[] = {bis, background, calm}; + }; + class BackgroundTrack01a_F + { + type = "soundtrack"; + theme = "safe"; + tags[] = {bis, background, calm}; + }; + class BackgroundTrack02_F + { + type = "soundtrack"; + theme = "safe"; + tags[] = {bis, background, calm}; + }; + class Track01_Proteus + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track02_SolarPower + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track03_OnTheRoad + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track04_Underwater1 + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track05_Underwater2 + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track06_CarnHeli + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track07_actionDark + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track08_Night_ambient + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track09_Night_percussions + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track10_StageB_action + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track11_StageB_stealth + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track12_StageC_action + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track13_StageC_negative + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track14_MainMenu + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + class Track15_MainTheme + { + type = "soundtrack"; + theme = "electronic"; + tags[] = {bis, background}; + }; + + /* ---------------------------------------------- + a3\music_f_bootcamp + ---------------------------------------------- */ + + class LeadTrack01_F_Bootcamp + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, bootcamp}; + }; + class LeadTrack01b_F_Bootcamp + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, bootcamp}; + }; + class LeadTrack02_F_Bootcamp + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, bootcamp}; + }; + class LeadTrack03_F_Bootcamp + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, bootcamp}; + }; + + /* ---------------------------------------------- + a3\music_f_epa + ---------------------------------------------- */ + class LeadTrack01_F_EPA + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epa}; + }; + class LeadTrack02_F_EPA + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epa}; + }; + class LeadTrack02a_F_EPA + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epa}; + }; + class LeadTrack02b_F_EPA + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epa}; + }; + class LeadTrack03_F_EPA + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epa}; + }; + class LeadTrack03a_F_EPA + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epa}; + }; + class EventTrack01_F_EPA + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epa}; + }; + class EventTrack01a_F_EPA + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epa}; + }; + class EventTrack02_F_EPA + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epa}; + }; + class EventTrack02a_F_EPA + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epa}; + }; + class EventTrack03_F_EPA + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epa}; + }; + class EventTrack03a_F_EPA + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epa}; + }; + /* ---------------------------------------------- + a3\music_f_epb + ---------------------------------------------- */ + class LeadTrack01_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class LeadTrack01a_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class LeadTrack02_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class LeadTrack02a_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class LeadTrack02b_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class LeadTrack03_F_EPB + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead, epb}; + }; + class LeadTrack03a_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class LeadTrack04_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class EventTrack01_F_EPB + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epb}; + }; + class EventTrack01a_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class EventTrack02_F_EPB + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead, epb}; + }; + class EventTrack02a_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class EventTrack03_F_EPB + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead, epb}; + }; + class EventTrack04_F_EPB + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead, epb}; + }; + class EventTrack04a_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class EventTrack03a_F_EPB + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epb}; + }; + class ambientTrack01_F_EPB + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead, epb}; + }; + class BackgroundTrack01_F_EPB + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead, epb}; + }; + /* ---------------------------------------------- + a3\music_f_epc + ---------------------------------------------- */ + class LeadTrack01_F_EPC + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epc}; + }; + class LeadTrack02_F_EPC + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + class LeadTrack03_F_EPC + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead, epc}; + }; + class LeadTrack04_F_EPC + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + class LeadTrack05_F_EPC + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + class LeadTrack06_F_EPC + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + class LeadTrack06b_F_EPC + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + class EventTrack01_F_EPC + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead, epc}; + }; + class EventTrack02_F_EPC + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + class EventTrack02b_F_EPC + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + class EventTrack03_F_EPC + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epc}; + }; + class BackgroundTrack01_F_EPC + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead, epc}; + }; + class BackgroundTrack02_F_EPC + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epc}; + }; + class BackgroundTrack03_F_EPC + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, epc}; + }; + class BackgroundTrack04_F_EPC + { + type = "soundtrack"; + theme = "stealth"; + tags[] = {bis, lead, epc}; + }; + class C_EA_RadioBroadcast1 + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + class C_EA_RadioBroadcast2 + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + class C_EA_RadioMusic1 + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + class C_EA_RadioMusic2 + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, epc}; + }; + /* ---------------------------------------------- + a3\music_f_heli + ---------------------------------------------- */ + class LeadTrack01_F_Heli + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, heli}; + }; + /* ---------------------------------------------- + a3\music_f_mark + ---------------------------------------------- */ + class LeadTrack01_F_Mark + { + type = "soundtrack"; + theme = "action"; + tags[] = {bis, lead, mark}; + }; + class LeadTrack02_F_Mark + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, mark}; + }; + class LeadTrack03_F_Mark + { + type = "soundtrack"; + theme = "calm"; + tags[] = {bis, lead, mark}; + }; +}; \ No newline at end of file diff --git a/addons/music/config.cpp b/addons/music/config.cpp index de9477a5f..bfe47754a 100644 --- a/addons/music/config.cpp +++ b/addons/music/config.cpp @@ -9,7 +9,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"CBA_common"}; version = VERSION; - authors[] = {"Fishy"}; + authors[] = {"Dedmen","Dorbedo", "Fishy"}; }; }; diff --git a/addons/music/fnc_compileMusic.sqf b/addons/music/fnc_compileMusic.sqf index cc30084c4..9620ae490 100644 --- a/addons/music/fnc_compileMusic.sqf +++ b/addons/music/fnc_compileMusic.sqf @@ -2,13 +2,13 @@ Function: CBA_fnc_compileMusic Description: - A function used to gather a list of all usable music. + A function used to gather a list of all music classes Parameters: none Returns: - Array of compiled music + Array of compiled music (in CLASS format) Example: (begin example) @@ -16,32 +16,22 @@ Example: (end example) Author: - Fishy, Dedmen + Fishy, Dorbedo, Dedmen ---------------------------------------------------------------------------- */ #include "script_component.hpp" if (isNil QGVARMAIN(compiledMusic)) then { private _config = configFile >> 'CfgMusic'; private _missionConfig = missionConfigFile >> 'CfgMusic'; - private _unsortedSongs = []; - - for [{_i=0}, {_i < (count _config)}, {INC(_i)}] do { - private _song = _config select _i; - private _songDuration = getNumber (_song >> 'duration'); - if (_songDuration > 0) then { - _unsortedSongs pushBack (configName _song); - }; - }; - for [{_i=0}, {_i < (count _missionConfig)}, {INC(_i)}] do { - private _song = _missionConfig select _i; - private _songDuration = getNumber (_song >> 'duration'); - if (_songDuration > 0) then { - _unsortedSongs pushBack (configName _song); - }; - }; + private _allMusic = configProperties [MissionConfigFile >> "CfgMusic", "(getNumber(_x >> 'duration')) > 0",true]; + _allMusic append configProperties [configFile >> "CfgMusic", "(getNumber(_x >> 'duration')) > 0",true]; + private _unsortedSongs = []; + { + _unsortedSongs pushBackUnique (configName _x); + } forEach _allMusic; - GVARMAIN(compiledMusic) = _unsortedSongs; + GVARMAIN(compiledMusic) = +_unsortedSongs; }; GVARMAIN(compiledMusic) diff --git a/addons/music/fnc_findMusic.sqf b/addons/music/fnc_findMusic.sqf index 9164c1d12..f71e53e6f 100644 --- a/addons/music/fnc_findMusic.sqf +++ b/addons/music/fnc_findMusic.sqf @@ -7,14 +7,14 @@ Description: Parameters: 1: A string or array of strings, defining music "type". 2: A string or array of strings, defining tags/themes to look for. - 3: Array (optional) of song classes to search. Uses full list by default + 3: Array (optional) of music to search. Uses all music in game by default. values can be either class or config Returns: - array or results + array of classes that fit the bill. Example: (begin example) - _results = ["song","stealth"] call CBA_fnc_searchMusic + _results = ["soundtrack","stealth"] call CBA_fnc_searchMusic (end example) Author: @@ -22,7 +22,6 @@ Author: ---------------------------------------------------------------------------- */ #include "script_component.hpp" - params [["_searchType","any",["",[]]],["_searchTags","any",["",[]]],["_searchTracks",([] call CBA_fnc_compileMusic),[[]]]]; if (IS_STRING(_searchType)) then {_searchType = [_searchType];}; @@ -41,7 +40,13 @@ private _results = []; { private _track = _x; - private _config = [_track] call CBA_fnc_getMusicPath; + private _config = _x; + if (IS_CONFIG(_track)) then { + _track = configName _x; + } else { + _config = [_track] call CBA_fnc_getMusicPath; + }; + if (IS_CONFIG(_config)) then { private _type = getText (_config >> 'type'); if (_type == "") then {_type = DEFAULT_SONG_TYPE}; @@ -50,19 +55,19 @@ private _results = []; if (count _searchTags > 0) then { private _tags = getArray (_config >> 'tags'); private _theme = getText (_config >> 'theme'); - _tags pushBack _theme; //BIS sounds dont have tags so use their theme instead + _tags pushBackUnique _theme; //Take the theme if no tags found for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { _tag = toLower (_tags select _i); if (count _searchTags == 0 || {_tag in _searchTags}) then { _i = count _tags; - _results pushBack _track; + _results pushBackUnique _track; }; }; } else { //No tags required so add it - _results pushBack _track; + _results pushBackUnique _track; }; - } + }; }; } forEach _searchTracks; diff --git a/addons/music/fnc_getMusicData.sqf b/addons/music/fnc_getMusicData.sqf index 6e837dade..982a96fa0 100644 --- a/addons/music/fnc_getMusicData.sqf +++ b/addons/music/fnc_getMusicData.sqf @@ -5,8 +5,8 @@ Description: A function used to return data from the given music class Parameters: - one string OR one config path, and a data type (eg 'name') - + CONFIG or CLASS- music path or class name + DATA- the desired config entry Returns: data entry for requested music class @@ -16,23 +16,15 @@ Example: (end example) Author: - Fishy + Fishy, Dedmen ---------------------------------------------------------------------------- */ #include "script_component.hpp" -params [["_className",""],["_dataType","name"]]; -private "_config"; +params [["_config","",["",configFile]],["_dataType","name"]]; -if (IS_STRING(_classname)) then { - //Is a string, get config - _config = [_className] call CBA_fnc_getMusicPath; -} else { - if (IS_CONFIG(_className)) then { - _config = _className; - }; -}; +if (IS_STRING(_config)) then {_config = [_config] call CBA_fnc_getMusicPath;}; -If ((isNil "_config")||{!IS_CONFIG(_config)}) exitWith {ERROR_1("Config not found",_className);}; +If ((isNil "_config") || {!IS_CONFIG(_config)}) exitWith {ERROR_1("Config not found", _config); nil}; //Now we have a config, grab the data -[_config,_dataType,nil] call BIS_fnc_returnConfigEntry +[_config, _dataType, nil] call BIS_fnc_returnConfigEntry diff --git a/addons/music/fnc_getMusicPath.sqf b/addons/music/fnc_getMusicPath.sqf index e34dec8ea..dcdcda588 100644 --- a/addons/music/fnc_getMusicPath.sqf +++ b/addons/music/fnc_getMusicPath.sqf @@ -20,15 +20,17 @@ Authors: ---------------------------------------------------------------------------- */ #include "script_component.hpp" -if (!params [["_className","",[""]]]) exitWith {WARNING('No classname was provided');}; +if (!params [["_className","",["",configFile]]]) exitWith {WARNING('No classname was provided'); nil}; -private _config = configFile >> 'CfgMusic' >> _className; +if (IS_CONFIG(_className)) exitWith {_className}; + +private _config = missionConfigFile >> 'CfgMusic' >> _className; private _duration = getNumber (_config >> "duration"); -if (_duration == 0) then { - _config = missionConfigFile >> "CfgMusic" >> _className; +if (_duration isEqualTo 0) then { + _config = configFile >> "CfgMusic" >> _className; _duration = getNumber (_config >> "duration"); - if (_duration == 0) exitWith {WARNING_1("No path found for class",_className)}; + if (_duration isEqualTo 0) exitWith {WARNING_1("No path found for class",_className); nil}; }; _config diff --git a/addons/music/fnc_getMusicPlaying.sqf b/addons/music/fnc_getMusicPlaying.sqf index 34c36e431..5fb612877 100644 --- a/addons/music/fnc_getMusicPlaying.sqf +++ b/addons/music/fnc_getMusicPlaying.sqf @@ -16,13 +16,11 @@ Example: (end example) Author: - Fishy + Fishy, Dedmen ---------------------------------------------------------------------------- */ #include "script_component.hpp" -if (!params [["_bool",false,[false]]]) exitWith {WARNING('Incorrect param');}; - -if (isNil QGVAR(track)) exitWith {['', 0, 0, 0]}; +if (isNil QGVAR(track)) exitWith {['', 0, 0]}; GVAR(track) params ["_class","_startTime","_playPos","_duration"]; diff --git a/addons/music/fnc_isMusicPlaying.sqf b/addons/music/fnc_isMusicPlaying.sqf index e874fa08c..79db5360e 100644 --- a/addons/music/fnc_isMusicPlaying.sqf +++ b/addons/music/fnc_isMusicPlaying.sqf @@ -2,7 +2,7 @@ Function: CBA_fnc_isMusicPlaying Description: - A function used to return the current time on playing music. Must have been started with CBA_fnc_playMusic + Function that checks if music is currently playing Parameters: none @@ -16,12 +16,9 @@ Example: (end example) Author: - Fishy + Dedmen, Commy2, Fishy ---------------------------------------------------------------------------- */ #include "script_component.hpp" - -if (isNil QGVAR(track)) exitWith {false}; - -true +!isNil QGVAR(track) diff --git a/addons/music/fnc_playMusic.sqf b/addons/music/fnc_playMusic.sqf index 241831923..e6f0056b0 100644 --- a/addons/music/fnc_playMusic.sqf +++ b/addons/music/fnc_playMusic.sqf @@ -5,12 +5,12 @@ Description: A function used to play music. Parameters: - 1: CLASS Class to play - 2: INT Position to play from (default: 0) - 3: BOOL allowed to interupt already playing music (default: true) + 1: CLASS or CONFIG- music to play + 2: INT- Position to play from (default: 0) + 3: BOOL- allowed to interupt already playing music (default: true) Returns: - BOOL -true if started playing music + BOOL- true if started playing music Example: (begin example) @@ -19,18 +19,17 @@ Example: Author: - Fishy + Fishy, Dedmen ---------------------------------------------------------------------------- */ #include "script_component.hpp" -params [["_className","",[""]],["_time",0,[0]],["_overWrite", true,[true]]]; +params [["_className","",["",configFile]],["_time",0,[0]],["_overWrite", true,[true]]]; -if (_className isEqualTo "") exitWith { - WARNING("No class given"); - false -}; +if (_className isEqualTo "") exitWith {WARNING("No class given"); false}; + +If ((!_overWrite) && {call CBA_fnc_isMusicPlaying}) exitWith {false}; -If ((!_overWrite)&&{[true] call CBA_fnc_getMusicPlaying}) exitWith {false}; +if (IS_CONFIG(_className)) then {_className = configname _className;}; private _return = false; diff --git a/addons/music/fnc_stopMusic.sqf b/addons/music/fnc_stopMusic.sqf index 8904ce901..a327d1714 100644 --- a/addons/music/fnc_stopMusic.sqf +++ b/addons/music/fnc_stopMusic.sqf @@ -2,17 +2,17 @@ Function: CBA_fnc_stopMusic Description: - A function used to stop any music playing. Must have been started with CBA_fnc_playMusic, otherwise it is ignored. + A function used to stop any music playing. Parameters: none Returns: - BOOL: true if music was stopped, false if already stopped + nil Example: (begin example) - _bool = call CBA_fnc_stopMusic; + _nothing = call CBA_fnc_stopMusic; (end example) Author: @@ -22,4 +22,5 @@ Author: playMusic ["",0]; GVAR(track) = nil; -true + +nil From 2f42698d928d6c256b6ae8af6b4b191a2f9a78ad Mon Sep 17 00:00:00 2001 From: Fishy Date: Thu, 9 Mar 2017 22:21:26 +0000 Subject: [PATCH 33/37] Fixed tabs in CfgMusic --- addons/music/CfgMusic.hpp | 884 +++++++++++++++++++------------------- 1 file changed, 442 insertions(+), 442 deletions(-) diff --git a/addons/music/CfgMusic.hpp b/addons/music/CfgMusic.hpp index 5817cbed0..3a72ee60b 100644 --- a/addons/music/CfgMusic.hpp +++ b/addons/music/CfgMusic.hpp @@ -3,578 +3,578 @@ class CfgMusic /* ---------------------------------------------- a3\music_f ---------------------------------------------- */ - class LeadTrack01_F - { + class LeadTrack01_F + { type = "soundtrack"; - theme = "safe"; + theme = "safe"; tags[] = {bis, lead}; - }; - class LeadTrack01a_F - { + }; + class LeadTrack01a_F + { type = "soundtrack"; - theme = "safe"; + theme = "safe"; tags[] = {bis, lead}; - }; - class LeadTrack01b_F - { + }; + class LeadTrack01b_F + { type = "soundtrack"; - theme = "safe"; + theme = "safe"; tags[] = {bis, lead}; - }; - class LeadTrack01c_F - { + }; + class LeadTrack01c_F + { type = "soundtrack"; - theme = "safe"; + theme = "safe"; tags[] = {bis, lead}; - }; - class LeadTrack02_F - { + }; + class LeadTrack02_F + { type = "soundtrack"; - theme = "safe"; + theme = "safe"; tags[] = {bis, lead}; - }; - class LeadTrack03_F - { + }; + class LeadTrack03_F + { type = "soundtrack"; - theme = "combat"; + theme = "combat"; tags[] = {bis, lead}; - }; - class LeadTrack04_F - { + }; + class LeadTrack04_F + { type = "soundtrack"; - theme = "combat"; + theme = "combat"; tags[] = {bis, lead, action}; - }; - class LeadTrack04a_F - { + }; + class LeadTrack04a_F + { type = "soundtrack"; - theme = "combat"; + theme = "combat"; tags[] = {bis, lead, action}; - }; - class LeadTrack05_F - { + }; + class LeadTrack05_F + { type = "soundtrack"; - theme = "combat"; + theme = "combat"; tags[] = {bis, lead, action}; - }; - class LeadTrack06_F - { + }; + class LeadTrack06_F + { type = "soundtrack"; - theme = "stealth"; + theme = "stealth"; tags[] = {bis, lead}; - }; - class ambientTrack01_F - { + }; + class ambientTrack01_F + { type = "ambient"; - theme = "stealth"; + theme = "stealth"; tags[] = {bis}; - }; - class ambientTrack01a_F - { - type = "ambient"; - theme = "stealth"; + }; + class ambientTrack01a_F + { + type = "ambient"; + theme = "stealth"; tags[] = {bis}; - }; - class ambientTrack01b_F - { - type = "ambient"; - theme = "stealth"; + }; + class ambientTrack01b_F + { + type = "ambient"; + theme = "stealth"; tags[] = {bis}; - }; - class ambientTrack03_F - { - type = "ambient"; - theme = "safe"; + }; + class ambientTrack03_F + { + type = "ambient"; + theme = "safe"; tags[] = {bis}; - }; - class ambientTrack04a_F - { - type = "ambient"; - theme = "stealth"; + }; + class ambientTrack04a_F + { + type = "ambient"; + theme = "stealth"; tags[] = {bis}; - }; - class ambientTrack04_F - { - type = "ambient"; - theme = "stealth"; + }; + class ambientTrack04_F + { + type = "ambient"; + theme = "stealth"; tags[] = {bis}; - }; - class BackgroundTrack03_F - { + }; + class BackgroundTrack03_F + { type = "soundtrack"; - theme = "combat"; + theme = "combat"; tags[] = {bis, background, action}; - }; - class BackgroundTrack01_F - { - type = "soundtrack"; - theme = "safe"; + }; + class BackgroundTrack01_F + { + type = "soundtrack"; + theme = "safe"; tags[] = {bis, background, calm}; - }; - class BackgroundTrack01a_F - { - type = "soundtrack"; - theme = "safe"; + }; + class BackgroundTrack01a_F + { + type = "soundtrack"; + theme = "safe"; tags[] = {bis, background, calm}; - }; - class BackgroundTrack02_F - { - type = "soundtrack"; - theme = "safe"; + }; + class BackgroundTrack02_F + { + type = "soundtrack"; + theme = "safe"; tags[] = {bis, background, calm}; - }; - class Track01_Proteus - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track01_Proteus + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track02_SolarPower - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track02_SolarPower + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track03_OnTheRoad - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track03_OnTheRoad + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track04_Underwater1 - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track04_Underwater1 + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track05_Underwater2 - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track05_Underwater2 + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track06_CarnHeli - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track06_CarnHeli + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track07_actionDark - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track07_actionDark + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track08_Night_ambient - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track08_Night_ambient + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track09_Night_percussions - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track09_Night_percussions + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track10_StageB_action - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track10_StageB_action + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track11_StageB_stealth - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track11_StageB_stealth + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track12_StageC_action - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track12_StageC_action + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track13_StageC_negative - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track13_StageC_negative + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track14_MainMenu - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track14_MainMenu + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; - class Track15_MainTheme - { - type = "soundtrack"; - theme = "electronic"; + }; + class Track15_MainTheme + { + type = "soundtrack"; + theme = "electronic"; tags[] = {bis, background}; - }; + }; /* ---------------------------------------------- a3\music_f_bootcamp ---------------------------------------------- */ class LeadTrack01_F_Bootcamp - { - type = "soundtrack"; - theme = "action"; + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, bootcamp}; - }; - class LeadTrack01b_F_Bootcamp - { - type = "soundtrack"; - theme = "calm"; + }; + class LeadTrack01b_F_Bootcamp + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, bootcamp}; - }; - class LeadTrack02_F_Bootcamp - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack02_F_Bootcamp + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, bootcamp}; - }; - class LeadTrack03_F_Bootcamp - { - type = "soundtrack"; - theme = "calm"; + }; + class LeadTrack03_F_Bootcamp + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, bootcamp}; - }; + }; /* ---------------------------------------------- a3\music_f_epa ---------------------------------------------- */ class LeadTrack01_F_EPA - { - type = "soundtrack"; - theme = "calm"; + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epa}; - }; - class LeadTrack02_F_EPA - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack02_F_EPA + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epa}; - }; - class LeadTrack02a_F_EPA - { - type = "soundtrack"; - theme = "calm"; + }; + class LeadTrack02a_F_EPA + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epa}; - }; - class LeadTrack02b_F_EPA - { - type = "soundtrack"; - theme = "calm"; + }; + class LeadTrack02b_F_EPA + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epa}; - }; - class LeadTrack03_F_EPA - { - type = "soundtrack"; - theme = "calm"; + }; + class LeadTrack03_F_EPA + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epa}; - }; - class LeadTrack03a_F_EPA - { - type = "soundtrack"; - theme = "calm"; + }; + class LeadTrack03a_F_EPA + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epa}; - }; - class EventTrack01_F_EPA - { - type = "soundtrack"; - theme = "action"; + }; + class EventTrack01_F_EPA + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epa}; - }; - class EventTrack01a_F_EPA - { - type = "soundtrack"; - theme = "action"; + }; + class EventTrack01a_F_EPA + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epa}; - }; - class EventTrack02_F_EPA - { - type = "soundtrack"; - theme = "calm"; + }; + class EventTrack02_F_EPA + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epa}; - }; - class EventTrack02a_F_EPA - { - type = "soundtrack"; - theme = "calm"; + }; + class EventTrack02a_F_EPA + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epa}; - }; - class EventTrack03_F_EPA - { - type = "soundtrack"; - theme = "action"; + }; + class EventTrack03_F_EPA + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epa}; - }; - class EventTrack03a_F_EPA - { - type = "soundtrack"; - theme = "calm"; + }; + class EventTrack03a_F_EPA + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epa}; - }; + }; /* ---------------------------------------------- a3\music_f_epb ---------------------------------------------- */ class LeadTrack01_F_EPB - { - type = "soundtrack"; - theme = "action"; + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class LeadTrack01a_F_EPB - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack01a_F_EPB + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class LeadTrack02_F_EPB - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack02_F_EPB + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class LeadTrack02a_F_EPB - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack02a_F_EPB + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class LeadTrack02b_F_EPB - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack02b_F_EPB + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class LeadTrack03_F_EPB - { - type = "soundtrack"; - theme = "stealth"; + }; + class LeadTrack03_F_EPB + { + type = "soundtrack"; + theme = "stealth"; tags[] = {bis, lead, epb}; - }; - class LeadTrack03a_F_EPB - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack03a_F_EPB + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class LeadTrack04_F_EPB - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack04_F_EPB + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class EventTrack01_F_EPB - { - type = "soundtrack"; - theme = "calm"; + }; + class EventTrack01_F_EPB + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epb}; - }; - class EventTrack01a_F_EPB - { - type = "soundtrack"; - theme = "action"; + }; + class EventTrack01a_F_EPB + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class EventTrack02_F_EPB - { - type = "soundtrack"; - theme = "stealth"; + }; + class EventTrack02_F_EPB + { + type = "soundtrack"; + theme = "stealth"; tags[] = {bis, lead, epb}; - }; - class EventTrack02a_F_EPB - { - type = "soundtrack"; - theme = "action"; + }; + class EventTrack02a_F_EPB + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class EventTrack03_F_EPB - { - type = "soundtrack"; - theme = "stealth"; + }; + class EventTrack03_F_EPB + { + type = "soundtrack"; + theme = "stealth"; tags[] = {bis, lead, epb}; - }; - class EventTrack04_F_EPB - { - type = "soundtrack"; - theme = "stealth"; + }; + class EventTrack04_F_EPB + { + type = "soundtrack"; + theme = "stealth"; tags[] = {bis, lead, epb}; - }; - class EventTrack04a_F_EPB - { - type = "soundtrack"; - theme = "action"; + }; + class EventTrack04a_F_EPB + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class EventTrack03a_F_EPB - { - type = "soundtrack"; - theme = "action"; + }; + class EventTrack03a_F_EPB + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epb}; - }; - class ambientTrack01_F_EPB - { - type = "soundtrack"; - theme = "stealth"; + }; + class ambientTrack01_F_EPB + { + type = "soundtrack"; + theme = "stealth"; tags[] = {bis, lead, epb}; - }; - class BackgroundTrack01_F_EPB - { - type = "soundtrack"; - theme = "stealth"; + }; + class BackgroundTrack01_F_EPB + { + type = "soundtrack"; + theme = "stealth"; tags[] = {bis, lead, epb}; - }; + }; /* ---------------------------------------------- a3\music_f_epc ---------------------------------------------- */ class LeadTrack01_F_EPC - { - type = "soundtrack"; - theme = "calm"; + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epc}; - }; - class LeadTrack02_F_EPC - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack02_F_EPC + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; - class LeadTrack03_F_EPC - { - type = "soundtrack"; - theme = "stealth"; + }; + class LeadTrack03_F_EPC + { + type = "soundtrack"; + theme = "stealth"; tags[] = {bis, lead, epc}; - }; - class LeadTrack04_F_EPC - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack04_F_EPC + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; - class LeadTrack05_F_EPC - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack05_F_EPC + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; - class LeadTrack06_F_EPC - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack06_F_EPC + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; - class LeadTrack06b_F_EPC - { - type = "soundtrack"; - theme = "action"; + }; + class LeadTrack06b_F_EPC + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; - class EventTrack01_F_EPC - { - type = "soundtrack"; - theme = "stealth"; + }; + class EventTrack01_F_EPC + { + type = "soundtrack"; + theme = "stealth"; tags[] = {bis, lead, epc}; - }; - class EventTrack02_F_EPC - { - type = "soundtrack"; - theme = "action"; + }; + class EventTrack02_F_EPC + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; - class EventTrack02b_F_EPC - { - type = "soundtrack"; - theme = "action"; + }; + class EventTrack02b_F_EPC + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; - class EventTrack03_F_EPC - { - type = "soundtrack"; - theme = "calm"; + }; + class EventTrack03_F_EPC + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epc}; - }; - class BackgroundTrack01_F_EPC - { - type = "soundtrack"; - theme = "stealth"; + }; + class BackgroundTrack01_F_EPC + { + type = "soundtrack"; + theme = "stealth"; tags[] = {bis, lead, epc}; - }; - class BackgroundTrack02_F_EPC - { - type = "soundtrack"; - theme = "calm"; + }; + class BackgroundTrack02_F_EPC + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epc}; - }; - class BackgroundTrack03_F_EPC - { - type = "soundtrack"; - theme = "calm"; + }; + class BackgroundTrack03_F_EPC + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, epc}; - }; - class BackgroundTrack04_F_EPC - { - type = "soundtrack"; - theme = "stealth"; + }; + class BackgroundTrack04_F_EPC + { + type = "soundtrack"; + theme = "stealth"; tags[] = {bis, lead, epc}; - }; - class C_EA_RadioBroadcast1 - { - type = "soundtrack"; - theme = "action"; + }; + class C_EA_RadioBroadcast1 + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; - class C_EA_RadioBroadcast2 - { - type = "soundtrack"; - theme = "action"; + }; + class C_EA_RadioBroadcast2 + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; - class C_EA_RadioMusic1 - { - type = "soundtrack"; - theme = "action"; + }; + class C_EA_RadioMusic1 + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; - class C_EA_RadioMusic2 - { - type = "soundtrack"; - theme = "action"; + }; + class C_EA_RadioMusic2 + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, epc}; - }; + }; /* ---------------------------------------------- a3\music_f_heli ---------------------------------------------- */ class LeadTrack01_F_Heli - { - type = "soundtrack"; - theme = "action"; + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, heli}; - }; + }; /* ---------------------------------------------- a3\music_f_mark ---------------------------------------------- */ class LeadTrack01_F_Mark - { - type = "soundtrack"; - theme = "action"; + { + type = "soundtrack"; + theme = "action"; tags[] = {bis, lead, mark}; - }; - class LeadTrack02_F_Mark - { - type = "soundtrack"; - theme = "calm"; + }; + class LeadTrack02_F_Mark + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, mark}; - }; - class LeadTrack03_F_Mark - { - type = "soundtrack"; - theme = "calm"; + }; + class LeadTrack03_F_Mark + { + type = "soundtrack"; + theme = "calm"; tags[] = {bis, lead, mark}; - }; + }; }; \ No newline at end of file From d87b29fe8d3ea698d1b5d3710776a9a859a93a03 Mon Sep 17 00:00:00 2001 From: Fishy Date: Mon, 20 Mar 2017 21:54:52 +0000 Subject: [PATCH 34/37] Fixed some typos --- addons/music/CfgFunctions.hpp | 2 +- addons/music/fnc_compileMusic.sqf | 3 --- addons/music/fnc_getMusicPath.sqf | 2 +- addons/music/fnc_playMusic.sqf | 7 +++---- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/addons/music/CfgFunctions.hpp b/addons/music/CfgFunctions.hpp index beeb24407..0ce860571 100644 --- a/addons/music/CfgFunctions.hpp +++ b/addons/music/CfgFunctions.hpp @@ -19,7 +19,7 @@ class CfgFunctions // CBA_fnc_findMusic class findMusic { - description = "Find music of spesified type"; + description = "Find music of specified type"; file = "\x\cba\addons\music\fnc_findMusic.sqf"; }; // CBA_fnc_compileMusic diff --git a/addons/music/fnc_compileMusic.sqf b/addons/music/fnc_compileMusic.sqf index 9620ae490..162343776 100644 --- a/addons/music/fnc_compileMusic.sqf +++ b/addons/music/fnc_compileMusic.sqf @@ -21,9 +21,6 @@ Author: #include "script_component.hpp" if (isNil QGVARMAIN(compiledMusic)) then { - private _config = configFile >> 'CfgMusic'; - private _missionConfig = missionConfigFile >> 'CfgMusic'; - private _allMusic = configProperties [MissionConfigFile >> "CfgMusic", "(getNumber(_x >> 'duration')) > 0",true]; _allMusic append configProperties [configFile >> "CfgMusic", "(getNumber(_x >> 'duration')) > 0",true]; private _unsortedSongs = []; diff --git a/addons/music/fnc_getMusicPath.sqf b/addons/music/fnc_getMusicPath.sqf index dcdcda588..3634ddff9 100644 --- a/addons/music/fnc_getMusicPath.sqf +++ b/addons/music/fnc_getMusicPath.sqf @@ -24,7 +24,7 @@ if (!params [["_className","",["",configFile]]]) exitWith {WARNING('No classname if (IS_CONFIG(_className)) exitWith {_className}; -private _config = missionConfigFile >> 'CfgMusic' >> _className; +private _config = missionConfigFile >> "CfgMusic" >> _className; private _duration = getNumber (_config >> "duration"); if (_duration isEqualTo 0) then { diff --git a/addons/music/fnc_playMusic.sqf b/addons/music/fnc_playMusic.sqf index e6f0056b0..a87fb2b5d 100644 --- a/addons/music/fnc_playMusic.sqf +++ b/addons/music/fnc_playMusic.sqf @@ -6,17 +6,16 @@ Description: Parameters: 1: CLASS or CONFIG- music to play - 2: INT- Position to play from (default: 0) - 3: BOOL- allowed to interupt already playing music (default: true) + 2: INT- Starting position of track in seconds (default: 0) + 3: BOOL- allowed to interrupt already playing music (default: true) Returns: - BOOL- true if started playing music + BOOL- true if music started playing Example: (begin example) _bool = ["LeadTrack01_F_Bootcamp", 30, true] call CBA_fnc_playMusic; (end example) - Author: Fishy, Dedmen From 29c0d883a1a5857d792e496554d4d27006bd7d79 Mon Sep 17 00:00:00 2001 From: Fishy Date: Mon, 10 Apr 2017 16:41:44 +0100 Subject: [PATCH 35/37] support for APEX music+ minor improvements --- addons/music/CfgMusic.hpp | 94 ++++++++++++++++++++++++++++ addons/music/fnc_findMusic.sqf | 8 ++- addons/music/fnc_getMusicData.sqf | 26 +++++++- addons/music/fnc_getMusicPath.sqf | 3 +- addons/music/fnc_getMusicPlaying.sqf | 2 +- addons/music/script_component.hpp | 8 ++- 6 files changed, 131 insertions(+), 10 deletions(-) diff --git a/addons/music/CfgMusic.hpp b/addons/music/CfgMusic.hpp index 3a72ee60b..eff2b7247 100644 --- a/addons/music/CfgMusic.hpp +++ b/addons/music/CfgMusic.hpp @@ -577,4 +577,98 @@ class CfgMusic theme = "calm"; tags[] = {bis, lead, mark}; }; + /* ---------------------------------------------- + a3\music_f_exp (APEX) + ---------------------------------------------- */ + class LeadTrack01_F_EXP + { + type = "soundtrack"; + theme = "Action"; + tags[] = {bis, apex}; + }; + class LeadTrack01a_F_EXP + { + type = "soundtrack"; + theme = "Action"; + tags[] = {bis, apex}; + }; + class LeadTrack01b_F_EXP + { + type = "soundtrack"; + theme = "Action"; + tags[] = {bis, apex}; + }; + class LeadTrack01c_F_EXP + { + type = "soundtrack"; + theme = "Action"; + tags[] = {bis, apex}; + }; + class LeadTrack02_F_EXP + { + type = "soundtrack"; + theme = "Action"; + tags[] = {bis, apex}; + }; + class LeadTrack03_F_EXP + { + type = "soundtrack"; + theme = "Action"; + tags[] = {bis, apex}; + }; + class LeadTrack04_F_EXP + { + type = "soundtrack"; + theme = "Action"; + tags[] = {bis, apex}; + }; + class AmbientTrack01_F_EXP + { + type = "soundtrack"; + theme = "Stealth"; + tags[] = {bis, apex}; + }; + class AmbientTrack01a_F_EXP + { + type = "soundtrack"; + theme = "Stealth"; + tags[] = {bis, apex}; + }; + class AmbientTrack01b_F_EXP + { + type = "soundtrack"; + theme = "Stealth"; + tags[] = {bis, apex}; + }; + class AmbientTrack02_F_EXP + { + type = "soundtrack"; + theme = "Stealth"; + tags[] = {bis, apex}; + }; + class AmbientTrack02a_F_EXP + { + type = "soundtrack"; + theme = "Stealth"; + tags[] = {bis, apex}; + }; + class AmbientTrack02b_F_EXP + { + type = "soundtrack"; + theme = "Stealth"; + tags[] = {bis, apex}; + }; + class AmbientTrack02c_F_EXP + { + type = "soundtrack"; + theme = "Stealth"; + tags[] = {bis, apex}; + }; + class AmbientTrack02d_F_EXP + { + type = "soundtrack"; + theme = "Stealth"; + tags[] = {bis, apex}; + }; + }; \ No newline at end of file diff --git a/addons/music/fnc_findMusic.sqf b/addons/music/fnc_findMusic.sqf index f71e53e6f..804bd8705 100644 --- a/addons/music/fnc_findMusic.sqf +++ b/addons/music/fnc_findMusic.sqf @@ -27,8 +27,8 @@ params [["_searchType","any",["",[]]],["_searchTags","any",["",[]]],["_searchTra if (IS_STRING(_searchType)) then {_searchType = [_searchType];}; if (IS_STRING(_searchTags)) then {_searchTags = [_searchTags];}; -if (_searchType select 0 == "any") then {_searchType = [];}; -if (_searchTags select 0 == "any") then {_searchTags = [];}; +if (_searchType select 0 isEqualTo "any") then {_searchType = [];}; +if (_searchTags select 0 isEqualTo "any") then {_searchTags = [];}; _searchType = _searchType apply {If (IS_STRING(_x)) then {toLower _x} else {""};}; _searchTags = _searchTags apply {If (IS_STRING(_x)) then {toLower _x} else {""};}; @@ -49,12 +49,14 @@ private _results = []; if (IS_CONFIG(_config)) then { private _type = getText (_config >> 'type'); - if (_type == "") then {_type = DEFAULT_SONG_TYPE}; + if (_type isEqualTo "") then {_type = DEFAULT_SONG_TYPE}; if (count _searchType == 0 || {(toLower _type) in _searchType}) then { if (count _searchTags > 0) then { private _tags = getArray (_config >> 'tags'); + if (_tags isEqualTo []) then {_tags = DEFAULT_SONG_TAGS}; private _theme = getText (_config >> 'theme'); + if (_theme isEqualTo "") then {_theme = DEFAULT_SONG_THEME}; _tags pushBackUnique _theme; //Take the theme if no tags found for [{_i=0}, {_i < (count _tags)}, {_i = _i + 1}] do { _tag = toLower (_tags select _i); diff --git a/addons/music/fnc_getMusicData.sqf b/addons/music/fnc_getMusicData.sqf index 982a96fa0..f912dfb33 100644 --- a/addons/music/fnc_getMusicData.sqf +++ b/addons/music/fnc_getMusicData.sqf @@ -7,6 +7,8 @@ Description: Parameters: CONFIG or CLASS- music path or class name DATA- the desired config entry + Default- what to return if nothing found + Returns: data entry for requested music class @@ -20,11 +22,29 @@ Author: ---------------------------------------------------------------------------- */ #include "script_component.hpp" -params [["_config","",["",configFile]],["_dataType","name"]]; +params [ + ["_config","",["",configFile]], + ["_dataType","name",[""]], + ["_default", nil] +]; +if (_config isEqualTo "") exitWith {ERROR("Config not given"); _default}; if (IS_STRING(_config)) then {_config = [_config] call CBA_fnc_getMusicPath;}; -If ((isNil "_config") || {!IS_CONFIG(_config)}) exitWith {ERROR_1("Config not found", _config); nil}; +If ((isNil "_config") || {!IS_CONFIG(_config)}) exitWith {ERROR_1("Config not found for %1", _config); nil}; //Now we have a config, grab the data -[_config, _dataType, nil] call BIS_fnc_returnConfigEntry +private _return = [_config, _dataType, nil] call BIS_fnc_returnConfigEntry; + +if (!(isNil "_return")) exitWith {_return}; +if (!(isNil "_default")) exitWith {_default}; + +//Got nothing from config and a default value was not provided so see if a hard coded default exists +switch (toLower _dataType) do { + case "type": {_return = DEFAULT_SONG_TYPE;}; + case "theme": {_return = DEFAULT_SONG_THEME;}; + case "tags": {_return = DEFAULT_SONG_TAGS;}; + default {_return = nil;}; +}; + +_return \ No newline at end of file diff --git a/addons/music/fnc_getMusicPath.sqf b/addons/music/fnc_getMusicPath.sqf index 3634ddff9..b9e6a662a 100644 --- a/addons/music/fnc_getMusicPath.sqf +++ b/addons/music/fnc_getMusicPath.sqf @@ -30,7 +30,8 @@ private _duration = getNumber (_config >> "duration"); if (_duration isEqualTo 0) then { _config = configFile >> "CfgMusic" >> _className; _duration = getNumber (_config >> "duration"); - if (_duration isEqualTo 0) exitWith {WARNING_1("No path found for class",_className); nil}; }; +if (_duration isEqualTo 0) exitWith {WARNING_1("No path found for class %1",_className); nil}; + _config diff --git a/addons/music/fnc_getMusicPlaying.sqf b/addons/music/fnc_getMusicPlaying.sqf index 5fb612877..15aa88a8a 100644 --- a/addons/music/fnc_getMusicPlaying.sqf +++ b/addons/music/fnc_getMusicPlaying.sqf @@ -20,7 +20,7 @@ Author: ---------------------------------------------------------------------------- */ #include "script_component.hpp" -if (isNil QGVAR(track)) exitWith {['', 0, 0]}; +if (isNil QGVAR(track)) exitWith {["", 0, 0]}; GVAR(track) params ["_class","_startTime","_playPos","_duration"]; diff --git a/addons/music/script_component.hpp b/addons/music/script_component.hpp index e83938e10..f1b98497b 100644 --- a/addons/music/script_component.hpp +++ b/addons/music/script_component.hpp @@ -1,7 +1,11 @@ #define COMPONENT music #include "\x\cba\addons\main\script_mod.hpp" - #define DEBUG_MODE_FULL -#define DEFAULT_SONG_TYPE "song" + +#define DEFAULT_SONG_TYPE "undefinedType" +#define DEFAULT_SONG_THEME "undefinedTheme" +#define DEFAULT_SONG_TAGS ["undefinedTags"] + #include "\x\cba\addons\main\script_macros.hpp" + From 309d43d0350d9b596dc7beb1dc5cd6d89010140e Mon Sep 17 00:00:00 2001 From: Fishy Date: Mon, 10 Apr 2017 16:48:50 +0100 Subject: [PATCH 36/37] Improved getMusicData, tidied up headers --- addons/music/fnc_findMusic.sqf | 6 +++--- addons/music/fnc_getMusicData.sqf | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/music/fnc_findMusic.sqf b/addons/music/fnc_findMusic.sqf index 804bd8705..c892ac172 100644 --- a/addons/music/fnc_findMusic.sqf +++ b/addons/music/fnc_findMusic.sqf @@ -5,9 +5,9 @@ Description: A function used to return songs with given type and tags Parameters: - 1: A string or array of strings, defining music "type". - 2: A string or array of strings, defining tags/themes to look for. - 3: Array (optional) of music to search. Uses all music in game by default. values can be either class or config + 0: A string or array of strings, defining music "type". + 1: A string or array of strings, defining tags/themes to look for. + 2: Array (optional) of music to search. Uses all music in game by default. values can be either class or config Returns: array of classes that fit the bill. diff --git a/addons/music/fnc_getMusicData.sqf b/addons/music/fnc_getMusicData.sqf index f912dfb33..b3caa80a0 100644 --- a/addons/music/fnc_getMusicData.sqf +++ b/addons/music/fnc_getMusicData.sqf @@ -10,11 +10,11 @@ Parameters: Default- what to return if nothing found Returns: - data entry for requested music class + data entry for requested music class (or default if nothing found) Example: (begin example) - _musicName = ["LeadTrack01_F_Bootcamp","Duration"] call CBA_fnc_getMusicData; + _duration = ["LeadTrack01_F_Bootcamp","duration"] call CBA_fnc_getMusicData; (end example) Author: @@ -44,7 +44,6 @@ switch (toLower _dataType) do { case "type": {_return = DEFAULT_SONG_TYPE;}; case "theme": {_return = DEFAULT_SONG_THEME;}; case "tags": {_return = DEFAULT_SONG_TAGS;}; - default {_return = nil;}; }; _return \ No newline at end of file From de10876430e52622fd0550325d2cb2d95dc20849 Mon Sep 17 00:00:00 2001 From: Fishy Date: Mon, 10 Apr 2017 16:55:10 +0100 Subject: [PATCH 37/37] tabs fix --- addons/music/CfgMusic.hpp | 112 +++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/addons/music/CfgMusic.hpp b/addons/music/CfgMusic.hpp index eff2b7247..bb791a110 100644 --- a/addons/music/CfgMusic.hpp +++ b/addons/music/CfgMusic.hpp @@ -581,94 +581,94 @@ class CfgMusic a3\music_f_exp (APEX) ---------------------------------------------- */ class LeadTrack01_F_EXP - { + { type = "soundtrack"; theme = "Action"; tags[] = {bis, apex}; - }; - class LeadTrack01a_F_EXP - { + }; + class LeadTrack01a_F_EXP + { type = "soundtrack"; theme = "Action"; tags[] = {bis, apex}; - }; - class LeadTrack01b_F_EXP - { + }; + class LeadTrack01b_F_EXP + { type = "soundtrack"; theme = "Action"; tags[] = {bis, apex}; - }; - class LeadTrack01c_F_EXP - { - type = "soundtrack"; + }; + class LeadTrack01c_F_EXP + { + type = "soundtrack"; theme = "Action"; tags[] = {bis, apex}; - }; - class LeadTrack02_F_EXP - { - type = "soundtrack"; + }; + class LeadTrack02_F_EXP + { + type = "soundtrack"; theme = "Action"; tags[] = {bis, apex}; - }; - class LeadTrack03_F_EXP - { - type = "soundtrack"; + }; + class LeadTrack03_F_EXP + { + type = "soundtrack"; theme = "Action"; tags[] = {bis, apex}; - }; - class LeadTrack04_F_EXP - { - type = "soundtrack"; + }; + class LeadTrack04_F_EXP + { + type = "soundtrack"; theme = "Action"; tags[] = {bis, apex}; - }; - class AmbientTrack01_F_EXP - { - type = "soundtrack"; + }; + class AmbientTrack01_F_EXP + { + type = "soundtrack"; theme = "Stealth"; tags[] = {bis, apex}; - }; - class AmbientTrack01a_F_EXP - { - type = "soundtrack"; + }; + class AmbientTrack01a_F_EXP + { + type = "soundtrack"; theme = "Stealth"; tags[] = {bis, apex}; - }; - class AmbientTrack01b_F_EXP - { - type = "soundtrack"; + }; + class AmbientTrack01b_F_EXP + { + type = "soundtrack"; theme = "Stealth"; tags[] = {bis, apex}; - }; - class AmbientTrack02_F_EXP - { - type = "soundtrack"; + }; + class AmbientTrack02_F_EXP + { + type = "soundtrack"; theme = "Stealth"; tags[] = {bis, apex}; - }; - class AmbientTrack02a_F_EXP - { - type = "soundtrack"; + }; + class AmbientTrack02a_F_EXP + { + type = "soundtrack"; theme = "Stealth"; tags[] = {bis, apex}; - }; - class AmbientTrack02b_F_EXP - { - type = "soundtrack"; + }; + class AmbientTrack02b_F_EXP + { + type = "soundtrack"; theme = "Stealth"; tags[] = {bis, apex}; - }; - class AmbientTrack02c_F_EXP - { - type = "soundtrack"; + }; + class AmbientTrack02c_F_EXP + { + type = "soundtrack"; theme = "Stealth"; tags[] = {bis, apex}; - }; - class AmbientTrack02d_F_EXP - { - type = "soundtrack"; + }; + class AmbientTrack02d_F_EXP + { + type = "soundtrack"; theme = "Stealth"; tags[] = {bis, apex}; - }; + }; }; \ No newline at end of file