Exemple #1
0
        static void HandleRemoteControlServiceRemoteCommandReceived(object sender, RemoteCommandEventArgs e)
        {
#if DEBUG
            Console.WriteLine("[S] Remote command arrived. Handling it:");
#endif
            if (e.Command == "StageEditor")
            {
#if DEBUG
                Console.WriteLine("Command: StageEditor ( no arguments )");
#endif
                // No arguments
                Application.Invoke(delegate
                {
                    StageEditorWindow sew = new StageEditorWindow(
                        mStageOperationTypes,
                        StageOperationFactory,
                        StageOperationParametersFactory,
                        StageOperationParametersEditorFactory,
                        StageOperationHolderFactory,
                        FloatBitmapGtkFactory);

                    mStageEditorWindows.Add(sew);

                    if (sew.ShowLoadImageDialog())
                    {
                        sew.Show();
                    }
                    else
                    {
                        sew.CloseStageEditor();
                    }
                });
            }
            else if (e.Command == "StageEditor_CEStage_RAW")
            {
                string cestageFileName = e.Arguments[0];                                // .cestage filename
                string rawFileName     = e.Arguments[1];                                // Raw filename
                int    prescale        = int.Parse(e.Arguments[2]);                     // Prescale

#if DEBUG
                Console.WriteLine("Command: StageEditor_CEStage_RAW ( " +
                                  "cestageFileName = " + cestageFileName + ", " +
                                  "rawFileName = " + rawFileName + ", " +
                                  "prescale = " + prescale.ToString() + " )");
#endif
                Application.Invoke(delegate
                {
                    StageEditorWindow sew = new StageEditorWindow(
                        mStageOperationTypes,
                        StageOperationFactory,
                        StageOperationParametersFactory,
                        StageOperationParametersEditorFactory,
                        StageOperationHolderFactory,
                        FloatBitmapGtkFactory);

                    mStageEditorWindows.Add(sew);

                    sew.Show();
                    sew.LoadRaw(rawFileName, prescale);
                    //sew.LoadCEStage(cestageFileName, false);
                });
            }
            else if (e.Command == "StageEditor_CEStage")
            {
                string cestageFileName = e.Arguments[0];                                // .cestage filename

#if DEBUG
                Console.WriteLine("Command: StageEditor_CEStage ( " +
                                  "cestageFileName = " + cestageFileName + " )");
#endif

                Application.Invoke(delegate
                {
                    StageEditorWindow sew = new StageEditorWindow(
                        mStageOperationTypes,
                        StageOperationFactory,
                        StageOperationParametersFactory,
                        StageOperationParametersEditorFactory,
                        StageOperationHolderFactory,
                        FloatBitmapGtkFactory);

                    mStageEditorWindows.Add(sew);

                    sew.Show();
                    //sew.LoadCEStage(cestageFileName, true);
                });
            }
            else if (e.Command == "StageEditor_RAW")
            {
                string rawFileName = e.Arguments[0];                                    // Raw filename
                int    prescale    = int.Parse(e.Arguments[1]);                         // Prescale

#if DEBUG
                Console.WriteLine("Command: StageEditor_RAW ( " +
                                  "rawFileName = " + rawFileName + ", " +
                                  "prescale = " + prescale.ToString() + " )");
#endif

                Application.Invoke(delegate
                {
                    StageEditorWindow sew = new StageEditorWindow(
                        mStageOperationTypes,
                        StageOperationFactory,
                        StageOperationParametersFactory,
                        StageOperationParametersEditorFactory,
                        StageOperationHolderFactory,
                        FloatBitmapGtkFactory);

                    mStageEditorWindows.Add(sew);

                    sew.Show();
                    sew.LoadRaw(rawFileName, prescale);
                });
            }
            else if (e.Command == "AddToQueue_StageData")
            {
                string cestageData    = e.Arguments[0];                         // XML-serialized .cestage
                string rawFileName    = e.Arguments[1];                         // Raw filename
                string targetFileName = e.Arguments[2];                         // target file name
                string targetType     = e.Arguments[3];                         // target file type (jpeg, png, bmp)
                int    prescale       = int.Parse(e.Arguments[4]);              // prescale value

#if DEBUG
                Console.WriteLine("Command: AddToQueue_StageData ( " +
                                  "cestageData = " + cestageData + ", " +
                                  "rawFileName = " + rawFileName + ", " +
                                  "targetFileName = " + targetFileName + ", " +
                                  "targetType = " + targetType + ", " +
                                  "prescale = " + prescale.ToString() + " )");
#endif

                Application.Invoke(delegate
                {
                    Stage stage = new Stage(StageOperationFactory,
                                            StageOperationParametersFactory,
                                            FloatBitmapGtkFactory);

                    stage.LoadStageFromString(cestageData);

                    mRenderingQueue.Add(stage, rawFileName, prescale, targetFileName, targetType);
                    mRenderingQueueWindow.Show();
                });
            }
            else if (e.Command == "AddToQueue")
            {
                string cestageFileName = e.Arguments[0];                        // .cestage filename
                string rawFileName     = e.Arguments[1];                        // Raw filename
                string targetFileName  = e.Arguments[2];                        // target file name
                string targetType      = e.Arguments[3];                        // target file type (jpeg, png, bmp)
                int    prescale        = int.Parse(e.Arguments[4]);             // prescale value

#if DEBUG
                Console.WriteLine("Command: AddToQueue ( " +
                                  "cestageFileName = " + cestageFileName + ", " +
                                  "rawFileName = " + rawFileName + ", " +
                                  "targetFileName = " + targetFileName + ", " +
                                  "targetType = " + targetType + ", " +
                                  "prescale = " + prescale.ToString() + " )");
#endif
                Application.Invoke(delegate
                {
                    Stage stage = new Stage(StageOperationFactory,
                                            StageOperationParametersFactory,
                                            FloatBitmapGtkFactory);

                    stage.LoadStage(cestageFileName);

                    mRenderingQueue.Add(stage, rawFileName, prescale, targetFileName, targetType);
                    mRenderingQueueWindow.Show();
                });
            }
            else
            {
#if DEBUG
                Console.Write("Command: " + e.Command + " ( ");
                for (int i = 0; i < e.Arguments.Length - 1; i++)
                {
                    Console.Write("\"" + e.Arguments[i] + "\", ");
                }
                if (e.Arguments.Length > 0)
                {
                    Console.Write("\"" + e.Arguments[e.Arguments.Length - 1] + "\"");
                }
                Console.WriteLine(" )");
#endif
            }
        }
Exemple #2
0
        static void HandleRemoteControlServiceRemoteCommandReceived(object sender, RemoteCommandEventArgs e)
        {
            #if DEBUG
            Console.WriteLine("[S] Remote command arrived. Handling it:");
            #endif
            if (e.Command == "StageEditor")
            {
            #if DEBUG
                Console.WriteLine("Command: StageEditor ( no arguments )");
            #endif
                // No arguments
                Application.Invoke(delegate
                {
                    StageEditorWindow sew = new StageEditorWindow(
                        mStageOperationTypes,
                        StageOperationFactory,
                        StageOperationParametersFactory,
                        StageOperationParametersEditorFactory,
                        StageOperationHolderFactory,
                        FloatBitmapGtkFactory);

                    mStageEditorWindows.Add(sew);

                    if (sew.ShowLoadImageDialog())
                        sew.Show();
                    else
                        sew.CloseStageEditor();
                });
            }
            else if (e.Command == "StageEditor_CEStage_RAW")
            {
                string cestageFileName = e.Arguments[0];		// .cestage filename
                string rawFileName = e.Arguments[1];			// Raw filename
                int prescale = int.Parse(e.Arguments[2]);		// Prescale

            #if DEBUG
                Console.WriteLine("Command: StageEditor_CEStage_RAW ( " +
                    "cestageFileName = " + cestageFileName + ", " +
                    "rawFileName = " + rawFileName + ", " +
                    "prescale = " + prescale.ToString() + " )");
            #endif
                Application.Invoke(delegate
                {
                    StageEditorWindow sew = new StageEditorWindow(
                        mStageOperationTypes,
                        StageOperationFactory,
                        StageOperationParametersFactory,
                        StageOperationParametersEditorFactory,
                        StageOperationHolderFactory,
                        FloatBitmapGtkFactory);

                    mStageEditorWindows.Add(sew);

                    sew.Show();
                    sew.LoadRaw(rawFileName, prescale);
                    //sew.LoadCEStage(cestageFileName, false);
                });
            }
            else if (e.Command == "StageEditor_CEStage")
            {
                string cestageFileName = e.Arguments[0];		// .cestage filename

            #if DEBUG
                Console.WriteLine("Command: StageEditor_CEStage ( " +
                    "cestageFileName = " + cestageFileName + " )");
            #endif

                Application.Invoke(delegate
                {
                    StageEditorWindow sew = new StageEditorWindow(
                        mStageOperationTypes,
                        StageOperationFactory,
                        StageOperationParametersFactory,
                        StageOperationParametersEditorFactory,
                        StageOperationHolderFactory,
                        FloatBitmapGtkFactory);

                    mStageEditorWindows.Add(sew);

                    sew.Show();
                    //sew.LoadCEStage(cestageFileName, true);
                });
            }
            else if (e.Command == "StageEditor_RAW")
            {
                string rawFileName = e.Arguments[0];			// Raw filename
                int prescale = int.Parse(e.Arguments[1]);		// Prescale

            #if DEBUG
                Console.WriteLine("Command: StageEditor_RAW ( " +
                    "rawFileName = " + rawFileName + ", " +
                    "prescale = " + prescale.ToString() + " )");
            #endif

                Application.Invoke(delegate
                {
                    StageEditorWindow sew = new StageEditorWindow(
                        mStageOperationTypes,
                        StageOperationFactory,
                        StageOperationParametersFactory,
                        StageOperationParametersEditorFactory,
                        StageOperationHolderFactory,
                        FloatBitmapGtkFactory);

                    mStageEditorWindows.Add(sew);

                    sew.Show();
                    sew.LoadRaw(rawFileName, prescale);
                });
            }
            else if (e.Command == "AddToQueue_StageData")
            {
                string cestageData = e.Arguments[0];		// XML-serialized .cestage
                string rawFileName = e.Arguments[1];		// Raw filename
                string targetFileName = e.Arguments[2];		// target file name
                string targetType = e.Arguments[3];			// target file type (jpeg, png, bmp)
                int prescale = int.Parse(e.Arguments[4]);	// prescale value

            #if DEBUG
                Console.WriteLine("Command: AddToQueue_StageData ( " +
                    "cestageData = " + cestageData + ", " +
                    "rawFileName = " + rawFileName + ", " +
                    "targetFileName = " + targetFileName + ", " +
                    "targetType = " + targetType + ", " +
                    "prescale = " + prescale.ToString() + " )");
            #endif

                Application.Invoke(delegate
                {
                    Stage stage = new Stage(StageOperationFactory,
                        StageOperationParametersFactory,
                        FloatBitmapGtkFactory);

                    stage.LoadStageFromString(cestageData);

                    mRenderingQueue.Add(stage, rawFileName, prescale, targetFileName, targetType);
                    mRenderingQueueWindow.Show();
                });
            }
            else if (e.Command == "AddToQueue")
            {
                string cestageFileName = e.Arguments[0];		// .cestage filename
                string rawFileName = e.Arguments[1];		// Raw filename
                string targetFileName = e.Arguments[2];		// target file name
                string targetType = e.Arguments[3];			// target file type (jpeg, png, bmp)
                int prescale = int.Parse(e.Arguments[4]);	// prescale value

            #if DEBUG
                Console.WriteLine("Command: AddToQueue ( " +
                    "cestageFileName = " + cestageFileName + ", " +
                    "rawFileName = " + rawFileName + ", " +
                    "targetFileName = " + targetFileName + ", " +
                    "targetType = " + targetType + ", " +
                    "prescale = " + prescale.ToString() + " )");
            #endif
                Application.Invoke(delegate
                {
                    Stage stage = new Stage(StageOperationFactory,
                        StageOperationParametersFactory,
                        FloatBitmapGtkFactory);

                    stage.LoadStage(cestageFileName);

                    mRenderingQueue.Add(stage, rawFileName, prescale, targetFileName, targetType);
                    mRenderingQueueWindow.Show();
                });
            }
            else
            {
            #if DEBUG
                Console.Write("Command: " + e.Command + " ( ");
                for (int i = 0; i < e.Arguments.Length - 1; i++)
                {
                    Console.Write("\"" + e.Arguments[i] + "\", ");
                }
                if (e.Arguments.Length > 0)
                    Console.Write("\"" + e.Arguments[e.Arguments.Length - 1] + "\"");
                Console.WriteLine(" )");
            #endif
            }
        }