summaryrefslogtreecommitdiff
path: root/SDL_Core/src/components/HMI/app/view/media
diff options
context:
space:
mode:
Diffstat (limited to 'SDL_Core/src/components/HMI/app/view/media')
-rwxr-xr-xSDL_Core/src/components/HMI/app/view/media/common/LeftMenuView.js82
-rwxr-xr-xSDL_Core/src/components/HMI/app/view/media/playerView.js43
-rw-r--r--SDL_Core/src/components/HMI/app/view/media/sdl/controllsView.js210
-rwxr-xr-xSDL_Core/src/components/HMI/app/view/media/sdlmediaView.js111
4 files changed, 446 insertions, 0 deletions
diff --git a/SDL_Core/src/components/HMI/app/view/media/common/LeftMenuView.js b/SDL_Core/src/components/HMI/app/view/media/common/LeftMenuView.js
new file mode 100755
index 000000000..365baa927
--- /dev/null
+++ b/SDL_Core/src/components/HMI/app/view/media/common/LeftMenuView.js
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.LeftMenuView
+ * @desc Media Left Menu module visual representation
+ * @category View
+ * @filesource app/view/media/SiriusView.js
+ * @version 1.0
+ */
+
+SDL.LeftMenuView = Em.ContainerView.extend( {
+ /** View ID */
+ elementId: 'media_leftmenu',
+
+ /** View components */
+ childViews:
+ [
+ 'border',
+ 'cdButton',
+ 'sdlButton'
+ ],
+ /** Border decoration */
+ border: Em.View.extend( {
+ elementId: 'media_left_menu_border',
+ classNames: 'ls_border'
+ } ),
+
+ /** CD Station Button */
+ cdButton: SDL.Button.extend( {
+ classNameBindings:
+ [
+ 'SDL.CDModel.active:active_state'
+ ],
+ elementId: 'media_cdButton',
+ classNames: 'media-ls-item',
+ action: 'turnOnCD',
+ icon: 'images/media/ico_cd.png',
+ target: 'SDL.MediaController',
+ textBinding: Ember.Binding.oneWay( 'SDL.locale.label.view_media_cd' )
+ } ),
+ /** SDL Button */
+ sdlButton: SDL.Button.extend( {
+ classNameBindings:
+ [
+ 'SDL.States.media.sdlmedia.active:active_state'
+ ],
+ elementId: 'media_sdlButton',
+ classNames: 'media-ls-item',
+ hidden: function() {
+ return !SDL.SDLMediaController.currentAppId;
+ }.property( 'SDL.SDLMediaController.currentAppId' ),
+ textBinding: 'SDL.SDLMediaController.currentAppName',
+ iconBinding: 'SDL.SDLMediaController.currentAppIcon',
+ action: 'turnOnSDL',
+ target: 'SDL.MediaController'
+ } )
+
+} );
diff --git a/SDL_Core/src/components/HMI/app/view/media/playerView.js b/SDL_Core/src/components/HMI/app/view/media/playerView.js
new file mode 100755
index 000000000..318985d27
--- /dev/null
+++ b/SDL_Core/src/components/HMI/app/view/media/playerView.js
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.MediaPlayerView
+ * @desc Media Player module visual representation
+ * @category View
+ * @filesource app/view/media/common/MediaPalyerView.js
+ * @version 1.0
+ */
+SDL.playerView = Em.View.create( {
+
+ elementId: 'media_player_view_container',
+
+ classNameBindings:
+ [
+ 'SDL.States.media.player.active:active_state:inactive_state'
+ ]
+
+} ); \ No newline at end of file
diff --git a/SDL_Core/src/components/HMI/app/view/media/sdl/controllsView.js b/SDL_Core/src/components/HMI/app/view/media/sdl/controllsView.js
new file mode 100644
index 000000000..6f3cd05df
--- /dev/null
+++ b/SDL_Core/src/components/HMI/app/view/media/sdl/controllsView.js
@@ -0,0 +1,210 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.SDLMediaControlls
+ * @desc SDLMediaControlls visual representation
+ * @category View
+ * @filesource app/view/media/sdl/controllsView.js
+ * @version 1.0
+ */
+
+SDL.SDLMediaControlls = Em.ContainerView.create( {
+
+ childViews:
+ [
+ 'info',
+ 'Controls',
+ 'tuneButtons'
+ ],
+
+ /**
+ * Verification paramiter
+ */
+ sdlMediaControlls: "V2",
+
+ info: Em.View.extend( {
+
+ elementId: 'app_view_info',
+
+ template: Em.Handlebars
+ .compile( '{{#with view}}'
+ + '<div class="track-info">'
+ + '<div class="device">{{SDL.SDLAppController.model.deviceName}}</div>'
+ + '<div class="divider_o"></div>'
+ + '<div class="title textLimit">{{SDL.SDLAppController.model.appInfo.field1}}</div>'
+ + '<div class="album textLimit">{{SDL.SDLAppController.model.appInfo.field2}}</div>'
+ + '<div class="artist textLimit"{{bindAttr class="SDL.SDLModel.protocolVersion2State:hidden"}}>{{SDL.SDLAppController.model.appInfo.field3}}</div>'
+ + '<div class="time"{{bindAttr class="SDL.SDLModel.protocolVersion2State:timeV2"}}>{{SDL.SDLAppController.model.appInfo.mediaClock}}</div>'
+ + '<img class="cd_logo" {{bindAttr src="SDL.SDLAppController.model.appInfo.trackIcon" class="SDL.SDLModel.protocolVersion2State:cd_logoV2"}} />'
+ + '</div>' + '{{/with}}' )
+ } ),
+
+ Controls: Em.ContainerView.create( {
+
+ elementId: 'app_view_controlls',
+
+ /** View components */
+ childViews:
+ [
+ 'PrevTrackButton',
+ 'PlayButton',
+ 'NextTrackButton'
+ ],
+
+ classNames: 'player_controlls',
+
+ classNameBindings: 'SDL.SDLModel.protocolVersion2State:player_controllsV2',
+
+ PrevTrackButton: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'app_view_controlls_prev_track_button_v2',
+ classNames:
+ [
+ 'bc-item-big',
+ 'prevcd'
+ ],
+ classNames:
+ [
+ 'bc-item-big',
+ 'prevcd'
+ ],
+ icon: 'images/media/ico_prew.png',
+ presetName: 'SEEKLEFT'
+ } ),
+ PlayButton: SDL.Button.extend( {
+ elementId: 'app_view_controlls_play_button_v2',
+ classNames:
+ [
+ 'bc-item-big',
+ 'playcd'
+ ],
+ presetName: 'OK',
+ actionUp: function() {
+ SDL.SDLController.onSoftButtonOkActionUp( this.presetName );
+ },
+ actionDown: function() {
+ SDL.SDLController.onSoftButtonOkActionDown( this.presetName );
+ },
+ /**
+ * Define button
+ * template
+ */
+ template: Ember.Handlebars
+ .compile( '<img class="playIcon" {{bindAttr class="SDL.SDLAppController.model.isPlaying:visible:not-visible"}} src="images/media/ico_pause.png" />'
+ + '<img class="playIcon not-visible" {{bindAttr class="SDL.SDLAppController.model.isPlaying:not-visible:visible"}} src="images/media/ico-play.png" />' )
+ } ),
+ NextTrackButton: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'app_view_controlls_next_track_button_v2',
+ classNames:
+ [
+ 'bc-item-big',
+ 'nextcd'
+ ],
+ icon: 'images/media/ico_next.png',
+ presetName: 'SEEKRIGHT'
+ } )
+ } ),
+
+ tuneButtons: Em.ContainerView.create( {
+
+ elementId: 'sdl_media_presetButtons',
+
+ classNameBindings:
+ [
+ 'SDL.SDLModel.protocolVersion2State::hidden'
+ ],
+
+ classNames:
+ [
+ 'main-preset-buttons-wraper'
+ ],
+
+ childViews:
+ [
+ 'wrapper'
+ ],
+
+ wrapper: Em.ContainerView.extend( {
+
+ elementId: 'sdl_media_presetButtons_wrapper',
+
+ classNames: 'preset-items',
+
+ childViews:
+ [
+ '1',
+ '2',
+ '3',
+ '4',
+ '5',
+ '6'
+ ],
+
+ 1: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button1',
+ classNames: 'a0 preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.0',
+ templateName: 'text',
+ presetName: 'PRESET_1'
+ } ),
+ 2: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button2',
+ classNames: 'a1 preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.1',
+ templateName: 'text',
+ presetName: 'PRESET_2'
+ } ),
+ 3: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button3',
+ classNames: 'a2 preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.2',
+ templateName: 'text',
+ presetName: 'PRESET_3'
+ } ),
+ 4: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button4',
+ classNames: 'a3 preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.3',
+ templateName: 'text',
+ presetName: 'PRESET_4'
+ } ),
+ 5: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button5',
+ classNames: 'a4 preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.4',
+ templateName: 'text',
+ presetName: 'PRESET_5'
+ } ),
+ 6: SDL.Button.extend( SDL.PresetEvents, {
+ elementId: 'sdl_media_preset_button6',
+ classNames: 'a5 preset-item',
+ textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.5',
+ templateName: 'text',
+ presetName: 'PRESET_6'
+ } )
+ } )
+ } )
+} ); \ No newline at end of file
diff --git a/SDL_Core/src/components/HMI/app/view/media/sdlmediaView.js b/SDL_Core/src/components/HMI/app/view/media/sdlmediaView.js
new file mode 100755
index 000000000..70fc4d4e3
--- /dev/null
+++ b/SDL_Core/src/components/HMI/app/view/media/sdlmediaView.js
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * · Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * · Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * · Neither the name of the Ford Motor Company nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @name SDL.sdlView
+ * @desc SDL Media application module visual representation
+ * @category View
+ * @filesource app/view/media/sdlView.js
+ * @version 1.0
+ */
+SDL.sdlView = Em.ContainerView.create( {
+
+ /**
+ * View Id
+ */
+ elementId: 'sdl_view_container',
+
+ classNameBindings:
+ [
+ 'SDL.States.media.sdlmedia.active:active_state:inactive_state'
+ ],
+
+ /**
+ * View Components
+ */
+ childViews:
+ [
+ 'innerMenu',
+ 'controlls'
+ ],
+
+ controlls: SDL.SDLMediaControlls,
+
+ /**
+ * Deactivate View
+ */
+ deactivate: function() {
+ SDL.States.goToStates( 'info.apps' );
+ },
+
+ innerMenu: SDL.MenuList.extend( {
+
+ refreshItems: function() {
+ if( SDL.SDLAppController.model.appId == SDL.SDLMediaController.currentAppId ){
+ this.addItems( SDL.SDLAppController.model.softButtons, SDL.SDLAppController.model.appId );
+ }
+ }.observes( 'SDL.SDLAppController.model.softButtons.@each' ),
+
+ groupName: "MediaView",
+
+ content: Em.ContainerView.extend( {
+
+ classNames:
+ [
+ 'content'
+ ],
+
+ attributeBindings:
+ [
+ 'parentView.contentPositon:style'
+ ],
+
+ childViews:
+ [
+ 'optionsButton'
+ ],
+
+ optionsButton: SDL.Button.extend( {
+ text: 'Options',
+
+ templateName: 'arrow',
+
+ action: 'openCommandsList',
+ target: 'SDL.SDLAppController'
+ } )
+ } )
+ } )
+
+/** Calls SDL SystemContext switcher when turn On/Of SDL application */
+/*
+ * onTurnOnSDLApp: function(systemContextValue){
+ * if(SDL.States.media.sdl.active){
+ * SDL.SDLMediaController.onSystemContextSwitcher(SDL.SDLMediaController.eSystemContext.application);
+ * }else{
+ * SDL.SDLMediaController.onSystemContextSwitcher(SDL.SDLMediaController.eSystemContext.main); }
+ * }.observes('SDL.States.media.sdl.active')
+ */
+} ); \ No newline at end of file