Beispiel #1
0
        public void SavePlayer(VideoPlayers value)
        {
            this.PlayerType = value;

            RovioAPI           api      = rovio.API;
            MovementController movement = api.Movement;

            movement.SaveParameter(FlashParameters.video_player, (int)this.PlayerType);
        }
        void videoHandler_VideoWatchedEvent(VideoPlayers.VideoWatchedEventArgs ev)
        {
            if (MainWindow.CurrentMainTabIndex == MainWindow.TAB_MAIN_Playlists)
            {
                PlaylistVM pl = this.DataContext as PlaylistVM;
                if (pl == null) return;

                pl.PopulatePlaylistObjects();
                ShowNextEpisode();
            }
        }
        void videoHandler_VideoWatchedEvent(VideoPlayers.VideoWatchedEventArgs ev)
        {
            try
            {
                MainWindow mainwdw = (MainWindow)Window.GetWindow(this);

                if (MainWindow.CurrentMainTabIndex == MainWindow.TAB_MAIN_Dashboard && mainwdw.tileContinueWatching.Visibility == System.Windows.Visibility.Visible)
                    RefreshData();
            }
            catch { }
        }
 void videoHandler_VideoWatchedEvent(VideoPlayers.VideoWatchedEventArgs ev)
 {
     if (MainWindow.CurrentMainTabIndex == MainWindow.TAB_MAIN_Collection || MainWindow.CurrentMainTabIndex == MainWindow.TAB_MAIN_Pinned)
         ShowNextEpisode();
 }
Beispiel #5
0
        public void SavePlayer(VideoPlayers value)
        {
            this.PlayerType = value;

            RovioAPI api = rovio.API;
            MovementController movement = api.Movement;
            movement.SaveParameter(FlashParameters.video_player, (int)this.PlayerType);
        }
Beispiel #6
0
    /// <summary>
    /// Create a Sensor gameobject and attach & init required ROSSensorConnnection.
    /// </summary>
    /// <param name="rosSensorConnectionInput"></param>
    private ROSSensorConnectionInterface InstantiateSensor(ROSSensorConnectionInput rosSensorConnectionInput)
    {
        SensorType    sensorType        = rosSensorConnectionInput.sensorType;
        string        sensorIP          = rosSensorConnectionInput.url;
        int           sensorPort        = rosSensorConnectionInput.port;
        List <string> sensorSubscribers = new List <string>();
        ROSSensorConnectionInterface rosSensorConnection = null;

        foreach (SensorSubscribers subscriber in rosSensorConnectionInput.sensorSubscribers)
        {
            sensorSubscribers.Add(subscriber.ToString());
        }

        GameObject sensor = new GameObject(rosSensorConnectionInput.sensorName);

        sensor.transform.parent = this.transform;

        switch (sensorType)
        {
        case SensorType.PointCloud:
            Debug.Log("PointCloud Sensor created");
            PointCloudSensor_ROSSensorConnection pcSensor_rosSensorConnection = sensor.AddComponent <PointCloudSensor_ROSSensorConnection>();
            pcSensor_rosSensorConnection.InitilizeSensor(uniqueID, sensorIP, sensorPort, sensorSubscribers);
            ROSSensorConnections.Add(uniqueID, pcSensor_rosSensorConnection);
            rosSensorConnection = pcSensor_rosSensorConnection;
            break;

        case SensorType.Mesh:
            Debug.Log("Mesh Sensor created");
            MeshSensor_ROSSensorConnection meshSensor_rosSensorConnection = sensor.AddComponent <MeshSensor_ROSSensorConnection>();
            meshSensor_rosSensorConnection.InitilizeSensor(uniqueID, sensorIP, sensorPort, sensorSubscribers);
            ROSSensorConnections.Add(uniqueID, meshSensor_rosSensorConnection);
            rosSensorConnection = meshSensor_rosSensorConnection;
            break;

        case SensorType.LAMP:
            Debug.Log("LAMP Sensor created");
            LampSensor_ROSSensorConnection lamp_rosSensorConnection = sensor.AddComponent <LampSensor_ROSSensorConnection>();
            lamp_rosSensorConnection.InitilizeSensor(uniqueID, sensorIP, sensorPort, sensorSubscribers);
            ROSSensorConnections.Add(uniqueID, lamp_rosSensorConnection);
            rosSensorConnection = lamp_rosSensorConnection;
            break;

        case SensorType.PCFace:
            Debug.Log("PCFace Sensor created");
            PCFaceSensor_ROSSensorConnection pcFace_rosSensorConnection = sensor.AddComponent <PCFaceSensor_ROSSensorConnection>();
            pcFace_rosSensorConnection.InitilizeSensor(uniqueID, sensorIP, sensorPort, sensorSubscribers);
            ROSSensorConnections.Add(uniqueID, pcFace_rosSensorConnection);
            rosSensorConnection = pcFace_rosSensorConnection;
            break;

        case SensorType.Image:
            Debug.Log("Camera Stream created");
            CameraSensor_ROSSensorConnection camera_rosSensorConnection = sensor.AddComponent <CameraSensor_ROSSensorConnection>();
            VideoPlayers videoType = rosSensorConnectionInput.videoPlayers;
            switch (videoType)
            {
            case VideoPlayers.BackVideo:
                camera_rosSensorConnection.SetVideoType("BackVideo");
                break;

            case VideoPlayers.FrontVideo:
                camera_rosSensorConnection.SetVideoType("FrontVideo");
                break;

            case VideoPlayers.LeftVideo:
                camera_rosSensorConnection.SetVideoType("LeftVideo");
                break;

            case VideoPlayers.RightVideo:
                camera_rosSensorConnection.SetVideoType("RightVideo");
                break;

            default:
                Debug.Log("No Video Type Selected.");
                return(null);
            }
            camera_rosSensorConnection.InitilizeSensor(uniqueID, sensorIP, sensorPort, sensorSubscribers);
            ROSSensorConnections.Add(uniqueID, camera_rosSensorConnection);
            rosSensorConnection = camera_rosSensorConnection;
            break;

        default:
            Debug.Log("No sensor type selected");
            return(null);
        }


        // Add sensor to list of sensors in World Properties
        WorldProperties.AddSensor(uniqueID, sensor);

        uniqueID++;

        return(rosSensorConnection);
    }