Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Racked radio speakers #481

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Racked radio speakers #481

wants to merge 13 commits into from

Conversation

TheMagnetar
Copy link
Member

@TheMagnetar TheMagnetar commented Feb 4, 2018

When merged this pull request will:

  • Adds rack radio speakers. Since no GUI is available for racks, the activation/deactivation of the speaker is done over ace interaction.
  • Note: to be merged after AN/VRC-64 #480

@jonpas
Copy link
Member

jonpas commented Feb 9, 2018

Will review once #480 is merged.

@jonpas jonpas modified the milestones: 2.6.0, 2.7.0 Feb 12, 2018
Conflicts:
	addons/sys_rack/fnc_addRack.sqf
	addons/sys_rack/fnc_initVehicle.sqf
	addons/sys_rack/fnc_initializeRack.sqf
	addons/sys_rack/stringtable.xml
@ColinM9991-zz
Copy link
Contributor

@jonpas

What's the update on your previous comment? It looks like #480 has been merged.

@TheMagnetar
Copy link
Member Author

@ColinM9991 That it has been merged, it does not mean that it is going to be reviewed immediately. Note that this PR is labelled for 2.7 and 2.6 is not out yet.

@tbeswick96
Copy link
Contributor

Have an issue where once a radio speaker is turned on in a vehicle, it cannot be turned off, and any attempts to resolve it seem to bug the radio out, making it unusable

@TheMagnetar
Copy link
Member Author

Ah, fixed internally. I never really pushed it.

 Conflicts:
	addons/api/fnc_addRackToVehicle.sqf
	addons/sys_prc77/radio/fnc_initializeRadio.sqf
	addons/sys_rack/CfgAcreRacks.hpp
	addons/sys_rack/CfgVehicles.hpp
	addons/sys_rack/vrc64/__PREP__.sqf
	addons/sys_rack/vrc64/fnc_vrc64MountRadio.sqf
	addons/sys_rack/vrc64/fnc_vrc64MountableRadio.sqf
	addons/sys_rack/vrc64/fnc_vrc64UnmountRadio.sqf
// Loudspeakers
if (_radio in ACRE_ACCESSIBLE_RACK_RADIOS) then {
if ([_radio, "isExternalAudio"] call EFUNC(sys_data,dataEvent)) then {
_action = ["acre_loudspeaker", localize ELSTRING(sys_rack,turnOffSpeaker), "", {[((_this select 2) select 0), false] call EFUNC(sys_rack,activateRackSpeaker)}, {true}, {}, _params] call ace_interact_menu_fnc_createAction;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QGVAR?

private _obj = [_radioId] call EFUNC(sys_radio,getRadioObject);
private _pos = getPosASL _obj;

private _rackId = [_radioId] call EFUNC(sys_rack,getRackFromRadio);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all same for all radios, with just 2 cases based on handheld or rack radio. An outside function with arguments for that would probably be a good idea.

false;
params ["_radioId", "_event", "_eventData", "_radioData"];

(HASH_GET(_radioData, "audioPath") == "RACKSPEAKER")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for outer parentheses.

#include "script_component.hpp"
/*
* Author: ACRE2Team
* Sets the mounted radio external audio to ON/OFF.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* Toggles the mounted radio external audio.
Maybe rename the function accordingly as well.


params ["_radioId", "_active", ["_rackId",""]];

// TODO: For version 2.7. Implement check if rack has an external speaker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do it!? :D

@@ -183,5 +183,11 @@
<Spanish>Dejar de usar todas</Spanish>
<French>Arrêter de tout utiliser</French>
</Key>
<Key ID="STR_ACRE_sys_rack_turnOnSpeaker">
<English>Turn On Speaker</English>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does maybe Speaker On and Speaker Off fit better with the rest of action naming? (I am not sure.)

@@ -40,5 +40,6 @@ HASH_SET(_radioData,"volume",1);
HASH_SET(_radioData,"currentChannel",0);
HASH_SET(_radioData,"radioOn", 1);
HASH_SET(_radioData,"pressedButton", -1);
HASH_SET(_radioData,"powerSource", "BAT");
HASH_SET(_radioData,"powerSource","BAT");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our macro definition has spaces #define HASH_SET(hash, key, val)
To be consistent, I suggest:

Suggested change
HASH_SET(_radioData,"powerSource","BAT");
HASH_SET(_radioData," volume", 1);
HASH_SET(_radioData," currentChannel", 0);
HASH_SET(_radioData," radioOn", 1);
HASH_SET(_radioData," pressedButton", -1);
HASH_SET(_radioData," powerSource", "BAT");
HASH_SET(_radioData," pgm_pa_mode", "ON");
HASH_SET(_radioData," audioPath", "HEADSET");

@@ -41,5 +41,5 @@ for "_i" from 0 to (count _channels)-1 do {
HASH_SET(_radioData,"volume",1);
HASH_SET(_radioData,"currentChannel",0);
HASH_SET(_radioData,"radioOn",1);
HASH_SET(_radioData,"audioPath", "TOPAUDIO");
HASH_SET(_radioData,"audioPath","TOPAUDIO");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above:

Suggested change
HASH_SET(_radioData,"audioPath","TOPAUDIO");
HASH_SET(_radioData, "volume", 1);
HASH_SET(_radioData, "currentChannel", 0);
HASH_SET(_radioData, "radioOn", 1);
HASH_SET(_radioData, "audioPath", "TOPAUDIO");
HASH_SET(_radioData, "powerSource", "BAT");

HASH_SET(_radioData,"CTCSSTx", 150);
HASH_SET(_radioData,"CTCSSRx", 150);
HASH_SET(_radioData,"CTCSSTx",150);
HASH_SET(_radioData,"CTCSSRx",150);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@@ -29,6 +29,7 @@ HASH_SET(_rackData,"disabled",_disabled);
HASH_SET(_rackData,"mountedRadio",_mountedRadio);
HASH_SET(_rackData,"isRadioRemovable",_isRadioRemovable);
HASH_SET(_rackData,"wiredIntercoms",_intercoms);
HASH_SET(_rackData,"rackPosition",_rackPosition);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above:

Suggested change
HASH_SET(_rackData,"rackPosition",_rackPosition);
HASH_SET(_rackData, "name", _displayName);
HASH_SET(_rackData, "shortName", _shortName);
HASH_SET(_rackData, "allowed", _allowed);
HASH_SET(_rackData, "disabled", _disabled);
HASH_SET(_rackData, "mountedRadio", _mountedRadio);
HASH_SET(_rackData, "isRadioRemovable", _isRadioRemovable);
HASH_SET(_rackData, "wiredIntercoms", _intercoms);
HASH_SET(_rackData, "rackPosition", _rackPosition);
HASH_SET(_rackData, "vehicle", _vehicle);

@@ -83,4 +83,4 @@ HASH_SET(_radioData,"channelKnobPosition", 2); // Channel 1 (after on/off option
HASH_SET(_radioData,"volumeKnobPosition", 0);// mid-way
HASH_SET(_radioData,"programmingStep", 0);
HASH_SET(_radioData,"lastActiveChannel",0);
HASH_SET(_radioData,"audioPath", "HEADSET");
HASH_SET(_radioData,"audioPath","HEADSET");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
HASH_SET(_radioData,"audioPath","HEADSET");
HASH_SET(_radioData, "volume", 1);
HASH_SET(_radioData, "radioOn", 1);
HASH_SET(_radioData, "currentChannel", 0);
HASH_SET(_radioData, "channelKnobPosition", 2); // Channel 1 (after on/off options)
HASH_SET(_radioData, "volumeKnobPosition", 0);// mid-way
HASH_SET(_radioData, "programmingStep", 0);
HASH_SET(_radioData, "lastActiveChannel", 0);
HASH_SET(_radioData, "audioPath", "HEADSET");

@@ -82,8 +82,8 @@ HASH_SET(_radioData,"radioOn",1);
HASH_SET(_radioData,"volume",1);
HASH_SET(_radioData,"currentChannel",GVAR(manualChannel)); // Manual Channel
//HASH_SET(_radioData,"lastActiveChannel",GVAR(manualChannel));
HASH_SET(_radioData,"audioPath", "HEADSET");
HASH_SET(_radioData,"powerSource", "BAT");
HASH_SET(_radioData,"audioPath","HEADSET");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
HASH_SET(_radioData,"audioPath","HEADSET");
// General
HASH_SET(_radioData, "radioOn", 1);
HASH_SET(_radioData, "volume", 1);
HASH_SET(_radioData, "currentChannel", GVAR(manualChannel)); // Manual Channel
HASH_SET(_radioData, "audioPath", "HEADSET");
HASH_SET(_radioData, "powerSource", "BAT");
// Channel
HASH_SET(_radioData, "manualChannelSelection", 1); // Manual Frequency Selection Flag
HASH_SET(_radioData, "power", 4000);
HASH_SET(_radioData, "channelSpacing", 0); // 0: 25kHz, 1: 50kHz
HASH_SET(_radioData, "CTCSS", 0);
HASH_SET(_radioData, "modulation", "FM");
HASH_SET(_radioData, "encryption", 0);
HASH_SET(_radioData, "squelch", 0);
// Knobs
HASH_SET(_radioData, "mainKnobPosition", 2); // High Power Setting
HASH_SET(_radioData, "functionKnobPosition", 2); // Manual Frequency Selection (no Relais)
HASH_SET(_radioData, "volumeKnobPosition", 5);
HASH_SET(_radioData, "channelSpacingKnobPosition", 1); // 0-3
HASH_SET(_radioData, "kHzKnobPosition", 0);
HASH_SET(_radioData, "MHzKnobPosition", 0);
HASH_SET(_radioData, "MemorySlotKnobPosition", 0);
HASH_SET(_radioData, "NetworkKnobPosition", [ARR_3(1,2,3)]);

@TheMagnetar TheMagnetar modified the milestones: 2.7.0, 2.7.1 May 19, 2019
@jonpas jonpas removed the enhancement label Aug 5, 2019
@jonpas jonpas modified the milestones: 2.7.1, 2.8.0 Aug 5, 2019
@Jason-Terry
Copy link

Greetings, TheMagnetar are you still working on this?

@TheMagnetar
Copy link
Member Author

Yes. But other systems need to be in place before

@jonpas jonpas modified the milestones: 2.7.2, 2.7.3 Nov 24, 2019
@jonpas jonpas modified the milestones: 2.7.3, Backlog Apr 5, 2020
@Quantx
Copy link
Contributor

Quantx commented Nov 22, 2022

Any progress on this? Is there any work that needs to be done on this that I can help contribute to in terms of code? This is a huge feature request of mine and I'd love to see it in ACRE2!

@jonpas
Copy link
Member

jonpas commented Nov 22, 2022

Negative, currently we are not working on this.

Anyone is welcome to finish it however, it needs the addressed reviews and bringing it up-to-date with current codebase, as a starter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants