diff --git a/admin/Gemfile b/admin/Gemfile index 567f0e491..965a9d6fa 100644 --- a/admin/Gemfile +++ b/admin/Gemfile @@ -99,7 +99,7 @@ gem 'debugger' group :development, :test do gem 'capybara' - gem 'rspec-rails' + gem 'rspec-rails', '2.14.2' gem 'guard-rspec', '0.5.5' gem 'jasmine', '1.3.1' gem 'execjs', '1.4.0' diff --git a/web/app/assets/javascripts/configureTrackDialog.js b/web/app/assets/javascripts/configureTrackDialog.js new file mode 100644 index 000000000..0a144ad0f --- /dev/null +++ b/web/app/assets/javascripts/configureTrackDialog.js @@ -0,0 +1,119 @@ +(function (context, $) { + + "use strict"; + + context.JK = context.JK || {}; + context.JK.ConfigureTracksDialog = function (app) { + var logger = context.JK.logger; + var ASSIGNMENT = context.JK.ASSIGNMENT; + var VOICE_CHAT = context.JK.VOICE_CHAT; + + var $dialog = null; + var $instructions = null; + var $musicAudioTab = null; + var $musicAudioTabSelector = null; + var $voiceChatTab = null; + var $voiceChatTabSelector = null; + + var configure_audio_instructions = { + "Win32": "Choose the audio device you would like to use for this session. If needed, use arrow buttons to assign audio inputs " + + "to your tracks, to indicate what instrument you are playing on each track, and to assign audio outputs for listening. " + + "If you want to use a new audio device you have not tested/certified for latency using JamKazam, click the Add New Audio " + + "Gear button to test that device.", + + "MacOSX": "Choose the audio device you would like to use for this session. If needed, use arrow buttons to assign audio inputs " + + "to your tracks, to indicate what instrument you are playing on each track, and to assign audio outputs for listening. " + + "If you want to use a new audio device you have not tested/certified for latency using JamKazam, click the Add New Audio " + + "Gear button to test that device.", + + "Unix": "Choose the audio device you would like to use for this session. If needed, use arrow buttons to assign audio inputs " + + "to your tracks, to indicate what instrument you are playing on each track, and to assign audio outputs for listening. " + + "If you want to use a new audio device you have not tested/certified for latency using JamKazam, click the Add New Audio " + + "Gear button to test that device." + }; + + var configure_voice_instructions = "If you are using a microphone to capture your instrumental or vocal audio, you can simply use that mic " + + "for both music and chat. Otherwise, choose a device to use for voice chat, and use arrow buttons to " + + "select an input on that device."; + + function setInstructions(type) { + if (type === 'audio') { + var os = context.jamClient.GetOSAsString(); + $instructions.html(configure_audio_instructions[os]); + } + else if (type === 'voice') { + $instructions.html(configure_voice_instructions); + } + else { + throw "unknown type in setInstructions(" + type + ')'; + } + } + + function activateTab(type) { + if (type === 'voice') { + $musicAudioTab.hide(); + $voiceChatTab.show(); + + $musicAudioTabSelector.removeClass('selected'); + $voiceChatTabSelector.addClass('selected'); + } + else { + $musicAudioTab.show(); + $voiceChatTab.hide(); + + $musicAudioTabSelector.addClass('selected'); + $voiceChatTabSelector.removeClass('selected'); + } + } + + function validateVoiceChatSettings() { + return true; + } + + function showMusicAudioPanel() { + setInstructions('audio'); + activateTab('audio'); + + } + + function validateAudioSettings() { + return true; + } + + function showVoiceChatPanel() { + + } + + function events() { + $musicAudioTabSelector.click(function () { + // validate voice chat settings + if (validateVoiceChatSettings(true)) { + showMusicAudioPanel(false); + } + }); + + $voiceChatTabSelector.click(function () { + // validate audio settings + if (validateAudioSettings(true)) { + showVoiceChatPanel(false); + } + }); + } + + function initialize() { + + $dialog = $('#configure-tracks-dialog'); + $instructions = $dialog.find('.instructions span'); + $musicAudioTab = $dialog.find('div[tab-id="music-audio"]'); + $musicAudioTabSelector = $dialog.find('.tab-configure-audio'); + $voiceChatTab = $dialog.find('div[tab-id="voice-chat"]'); + $voiceChatTabSelector = $dialog.find('.tab-configure-voice'); + events(); + } + + this.initialize = initialize; + + return this; + }; + +})(window, jQuery); \ No newline at end of file diff --git a/web/app/assets/stylesheets/client/client.css b/web/app/assets/stylesheets/client/client.css index e1d7a51fe..54747b4e1 100644 --- a/web/app/assets/stylesheets/client/client.css +++ b/web/app/assets/stylesheets/client/client.css @@ -43,6 +43,7 @@ *= require ./invitationDialog *= require ./shareDialog *= require ./hoverBubble + *= require ./configureTracksDialog *= require ./recordingFinishedDialog *= require ./localRecordingsDialog *= require ./serverErrorDialog diff --git a/web/app/assets/stylesheets/client/configureTracksDialog.css.scss b/web/app/assets/stylesheets/client/configureTracksDialog.css.scss new file mode 100644 index 000000000..e04e64176 --- /dev/null +++ b/web/app/assets/stylesheets/client/configureTracksDialog.css.scss @@ -0,0 +1,5 @@ +#configure-tracks-dialog { + min-height: 500px; + max-height: 500px; + width:800px; +} \ No newline at end of file diff --git a/web/app/views/clients/_configure_tracks_dialog.html.haml b/web/app/views/clients/_configure_tracks_dialog.html.haml new file mode 100644 index 000000000..ec437ff32 --- /dev/null +++ b/web/app/views/clients/_configure_tracks_dialog.html.haml @@ -0,0 +1,24 @@ +.dialog{ layout: 'dialog', 'layout-id' => 'configure-tracks', id: 'configure-tracks-dialog'} + .content-head + = image_tag "content/icon_add.png", {:width => 19, :height => 19, :class => 'content-icon' } + %h1 configure tracks + .dialog-inner + .dialog-tabs + %a.selected.tab-configure-audio Music Audio + %a.tab-configure-voice Voice Chat + + .instructions + %span + + .clearall + + .tab{'tab-id' => 'music-audio'} + eat it + + + .clearall + + + .tab{'tab-id' => 'voice-chat'} + + .clearall diff --git a/web/app/views/clients/index.html.erb b/web/app/views/clients/index.html.erb index f07fd3a8e..4093b3f72 100644 --- a/web/app/views/clients/index.html.erb +++ b/web/app/views/clients/index.html.erb @@ -47,6 +47,7 @@ <%= render "friendSelector" %> <%= render "account_profile_avatar" %> <%= render "account_audio_profile" %> +<%= render "configure_tracks_dialog" %> <%= render "invitationDialog" %> <%= render "inviteMusicians" %> <%= render "hoverBand" %> @@ -247,6 +248,8 @@ var gearWizard = new JK.GearWizard(JK.app); gearWizard.initialize(loopbackWizard); + var configureTracksDialog = new JK.ConfigureTracksDialog(JK.app); + configureTracksDialog.initialize(); var testBridgeScreen = new JK.TestBridgeScreen(JK.app); testBridgeScreen.initialize();