Пример #1
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            iTracker             = new InputTrackerDoubleTouch();
            iTracker.View        = this;
            iTracker.EventBegin += Begin;

            AcceptsTouchEvents = true;
            BecomeFirstResponder();

            iHelper = new HelperKinsky(new string[] { });
            iHelper.ProcessOptionsFileAndCommandLine();
            iHelper.StartupRoom.Set("Sitting Room");

            ViewMaster view = new ViewMaster();

            iViewRoom = new ViewWidgetSelectorRoom();
            view.ViewWidgetSelectorRoom.Add(iViewRoom);

            iViewVolume = new ViewWidgetVolumeControl();
            view.ViewWidgetVolumeControl.Add(iViewVolume);

            Model model = new Model(view, new PlaySupport());

            iMediator = new Mediator(iHelper, model);

            iMediator.Open();

            iHelper.Stack.Start();
        }
Пример #2
0
        public static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Customize Time Configuration
            gen.snd.TimeConfiguration.Instance.Latency = 8000;
            gen.snd.TimeConfiguration.Instance.Rate    = 44100;


            ViewMaster <MasterViewContainer, MidiControlBase> Viewer = new ViewMaster <MasterViewContainer, MidiControlBase>(Assembly.GetExecutingAssembly());

//			ViewCollection = ViewPoint.EnumerateViewTypes<MasterViewContainer>(System.Reflection.Assembly.GetExecutingAssembly());
//			List<string> views = new List<string>();
//			foreach (IViewPoint view in ViewCollection) views.Add(view.Title);

            // MessageBox.Show(string.Join("\n",views.ToArray()));
            Application.Run(new ModestForm(Viewer.ViewCollection));
            Application.Exit();
//			Application.Run( new ModestForm(ViewCollection) );
//			try { Application.Run( container.GetExportedValue<ModestForm>() ); }
//			catch (Exception ex) {
//				if ( MessageBox.Show(string.Format("{0}\n---------\n{1}",ex.Message,ex.StackTrace), "OK to Exit, Cancel to throw Exception.", MessageBoxButtons.OKCancel,MessageBoxIcon.Error) == DialogResult.OK ) throw ex;
//				else return;
//			}
        }
Пример #3
0
 // Update Game Loop
 void Update()
 {
     if (acceptInput)
     {
         ViewMaster.CheckClick();
         ManageTurn();
     }
 }
 /// <summary>
 ///     Master Page neu laden (zB. dyn. Menüeinträgen bzw. Sprache)
 /// </summary>
 public void UpdateMaster()
 {
     if (MasterDetailPage != null)
     {
         MasterPage = new ViewMaster();
         MasterDetailPage.Master = MasterPage;
     }
 }
            /// <summary>
            ///     Navigationpage setzten, mit MasterDetailPage als parent oder eben nicht
            /// </summary>
            public void SetNavPage(ViewNavigation page, bool?useMasterDetail = null)
            {
                //destroy all pophandlers
                foreach (var handler in _popHandlers)
                {
                    handler.Cancel();
                }
                _popHandlers.Clear();

                //Alte Page muss sich wieder aus Events austragen
                //NavPage?.Dispose();

                //letzte navpage merken
                NavPage = page;

                //Master detail hinzufügen
                if (MasterDetailPage == null && useMasterDetail.HasValue && useMasterDetail.Value)
                {
                    MasterPage       = new ViewMaster();
                    MasterDetailPage = new ViewMasterDetail
                    {
                        Master = MasterPage,
                        Detail = page
                    };
                    _app.MainPage = MasterDetailPage;
                } //master detail entfernen
                else if (MasterDetailPage != null && useMasterDetail.HasValue && !useMasterDetail.Value)
                {
                    _app.MainPage    = page;
                    MasterDetailPage = null;
                    MasterPage       = null;
                }
                else
                {
                    //keine Änderung an MasterDetail Setting
                    if (MasterDetailPage != null)
                    {
                        MasterDetailPage.Detail = page;
                    }
                    else
                    {
                        _app.MainPage = page;
                    }
                }
            }
Пример #6
0
		public static void Main(string[] args)
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			
			ViewMaster<MasterViewContainer,MidiControlBase> Viewer = new ViewMaster<MasterViewContainer,MidiControlBase>(Assembly.GetExecutingAssembly());
			
//			ViewCollection = ViewPoint.EnumerateViewTypes<MasterViewContainer>(System.Reflection.Assembly.GetExecutingAssembly());
//			List<string> views = new List<string>();
//			foreach (IViewPoint view in ViewCollection) views.Add(view.Title);
			
			// MessageBox.Show(string.Join("\n",views.ToArray()));
			Application.Run( new ModestForm(Viewer.ViewCollection) );
			Application.Exit();
//			Application.Run( new ModestForm(ViewCollection) );
//			try { Application.Run( container.GetExportedValue<ModestForm>() ); }
//			catch (Exception ex) {
//				if ( MessageBox.Show(string.Format("{0}\n---------\n{1}",ex.Message,ex.StackTrace), "OK to Exit, Cancel to throw Exception.", MessageBoxButtons.OKCancel,MessageBoxIcon.Error) == DialogResult.OK ) throw ex;
//				else return;
//			}
		}
Пример #7
0
        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            CreateNotificationView();
            Xamarin.Insights.Identify(Helper.OptionInstallId.Value, null);
            ObjCRuntime.Class.ThrowOnInitFailure = false;

            Ticker tick = new Ticker();

            helper.Helper.SetStackExtender(this);
            helper.Helper.Stack.EventStatusChanged += StatusChanged;

            viewControllerRooms.StandbyButtonOffsetX = 5;

            ArtworkCacheInstance.Instance = new ArtworkCache();

            controlRotaryVolume.ViewBar.FontSize          = 12.0f;
            controlRotaryVolume.ViewBar.InnerCircleRadius = 25.0f;
            controlRotaryVolume.ViewBar.OuterCircleRadius = 30.0f;
            iViewWidgetVolumeControl = new ViewWidgetVolumeControl(controlRotaryVolume);

            iViewWidgetVolumeRotary = new ViewWidgetVolumeRotary("VolumeRotary", null);

            iViewWidgetVolumeButtons = new ViewWidgetVolumeButtons("VolumeButtons", null);
            iViewWidgetVolumeButtons.RepeatInterval = 0.1f;

            iVolumeController = new VolumeControllerIphone(viewControllerNowPlaying, iViewWidgetVolumeRotary, iViewWidgetVolumeButtons, controlVolume, controlTime, scrollView);
            iVolumeController.SetRockers(helper.OptionEnableRocker.Native);

            controlRotaryTime.ViewBar.FontSize          = 12.0f;
            controlRotaryTime.ViewBar.InnerCircleRadius = 25.0f;
            controlRotaryTime.ViewBar.OuterCircleRadius = 30.0f;
            iViewWidgetTime = new ViewWidgetTime(controlRotaryTime, viewHourGlass);

            iViewWidgetTimeRotary = new ViewWidgetTimeRotary("TimeRotary", null, iViewWidgetTime);

            iViewWidgetTimeButtons = new ViewWidgetTimeButtons("TimeButtons", null, iViewWidgetTime);
            iViewWidgetTimeButtons.RepeatInterval = 0.1f;

            iTimeController = new TimeControllerIphone(viewControllerNowPlaying, iViewWidgetTimeRotary, iViewWidgetTimeButtons, controlTime, controlVolume, scrollView);
            iTimeController.SetRockers(helper.OptionEnableRocker.Native);

            helper.OptionEnableRocker.EventValueChanged += delegate(object sender, EventArgs e) {
                iVolumeController.SetRockers(helper.OptionEnableRocker.Native);
                iTimeController.SetRockers(helper.OptionEnableRocker.Native);
            };

            Reachability.LocalWifiConnectionStatus();
            Reachability.ReachabilityChanged += delegate(object sender, EventArgs e) {
                OnReachabilityChanged();
            };

            new Action(delegate {
                Ticker ticker = new Ticker();

                iViewMaster = new ViewMaster();

                iHttpServer = new HttpServer(HttpServer.kPortKinskyTouch);
                iHttpClient = new HttpClient();

                iLibrary         = new MediaProviderLibrary(helper.Helper);
                iSharedPlaylists = new SharedPlaylists(helper.Helper);
                iLocalPlaylists  = new LocalPlaylists(helper.Helper, false);
                iLocalPlaylists.SaveDirectory.ResetToDefault();

                iPlaySupport = new PlaySupport();
                MediaProviderSupport support = new MediaProviderSupport(iHttpServer);
                PluginManager pluginManager  = new PluginManager(helper.Helper, iHttpClient, support);

                iLocator = new ContentDirectoryLocator(pluginManager, new AppRestartHandler());
                iLocator.Add(MediaProviderLibrary.kLibraryId, iLibrary);
                OptionBool optionSharedPlaylists = iLocator.Add(SharedPlaylists.kRootId, iSharedPlaylists);
                OptionBool optionLocalPlaylists  = iLocator.Add(LocalPlaylists.kRootId, iLocalPlaylists);

                iSaveSupport     = new SaveSupport(helper.Helper, iSharedPlaylists, optionSharedPlaylists, iLocalPlaylists, optionLocalPlaylists);
                iViewSaveSupport = new ViewSaveSupport(SavePlaylistHandler, iSaveSupport);

                helper.Helper.AddOptionPage(iLocator.OptionPage);

                InvokeOnMainThread(delegate {
                    AddViews();
                });

                iModel    = new Model(iViewMaster, iPlaySupport);
                iMediator = new Mediator(helper.Helper, iModel);

                OnFinishedLaunching();

                UserLog.WriteLine(string.Format("FinishedLaunching background tasks in {0} ms", ticker.MilliSeconds));
            }).BeginInvoke(null, null);

            //Trace.Level = Trace.kKinskyTouch;

            // If you have defined a view, add it here:
            navigationController.View.Frame = new CGRect(CGPoint.Empty, viewBrowser.Frame.Size);
            viewBrowser.InsertSubview(navigationController.View, 0);

            window.RootViewController = viewController;

            window.MakeKeyAndVisible();

            UserLog.WriteLine(string.Format("FinishedLaunching in {0} ms", tick.MilliSeconds));

            return(true);
        }
Пример #8
0
    private void LoadMap(string [] lines)
    {
        string rawData; // the entire line of text read from the file

        string[] dData; // the data after being split up based on the given delim above.

        string data = lines[0];

        int rad = System.Int32.Parse(data);

        MapMaster.SetMap(rad);

        for (int i = 1; i < lines.Length - 1; i++)
        {
            rawData = lines[i];
            dData   = rawData.Split(DELIM);

            if (dData.Length >= 5)
            {
                int  q = int.Parse(dData[(int)CellData.q]);
                int  r = int.Parse(dData[(int)CellData.r]);
                Unit u = ((dData[(int)CellData.unit] == "null") ? null : MapMaster.MakeTerrain(dData[(int)CellData.unit])); // if the hex has any terrain, the Get Terrain method returns the related type after spawning it.
                if (u != null)
                {
                    u.UDirection = int.Parse(dData[(int)CellData.unitRotation]); // rotation of the unit
                }
                HexSize  s = (HexSize)int.Parse((dData[(int)CellData.size]));
                TileType type;

                if (dData.Length <= (int)CellData.type)
                {
                    type = 0;
                }
                else
                {
                    type = (TileType)int.Parse((dData[(int)CellData.type]));
                }

                MapMaster.MakeTile(q, r);

                if (u != null) // depending on the natue of how we handle loading terrain, we might be checking for the string "null" here instead and not loading the object itself until we get to TerranPass
                {
                    MapMaster.Map[r, q].Unit            = u;
                    MapMaster.Map[r, q].Unit.CurrentHex = MapMaster.Map[r, q];
                    toBuild.Add(MapMaster.Map[r, q]);
                }

                if ((int)s != 0)
                {
                    MapMaster.Map[r, q].Size = s;
                    toSize.Add(MapMaster.Map[r, q]);
                }

                if ((int)type != 0)
                {
                    MapMaster.Map[r, q].Type = type;
                    toType.Add(MapMaster.Map[r, q]);
                }
            }
        }

        SizePass();    // any cells needing to have their scale changed are handled here.
        TerrainPass(); // any cells that are to have terrain is handled here.
        TypePass();    //any cells that need to have their cost and matieral changed are handled here.

        ViewMaster.PlaceCubes();
    }
Пример #9
0
        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Ticker tick = new Ticker();

            helper.Helper.SetStackExtender(this);
            helper.Helper.Stack.EventStatusChanged += StatusChanged;

            ArtworkCacheInstance.Instance = new ArtworkCache();

            controlRotaryVolume.ViewBar.FontSize          = 15.0f;
            controlRotaryVolume.ViewBar.InnerCircleRadius = 30.0f;
            controlRotaryVolume.ViewBar.OuterCircleRadius = 35.0f;
            iViewWidgetVolumeControl = new ViewWidgetVolumeControl(controlRotaryVolume);

            iViewWidgetVolumeButtons = new ViewWidgetVolumeButtons("VolumeButtons", null);
            iViewWidgetVolumeButtons.RepeatInterval = 0.1f;

            iViewWidgetVolumeRotary = new ViewWidgetVolumeRotary("VolumeRotary", null);

            iVolumeController = new VolumeControllerIpad(iViewWidgetVolumeButtons, iViewWidgetVolumeRotary, controlVolume);
            iVolumeController.SetRockers(helper.OptionEnableRocker.Native);
            viewController.SetVolumeController(iVolumeController);

            controlRotaryTime.ViewBar.FontSize          = 15.0f;
            controlRotaryTime.ViewBar.InnerCircleRadius = 30.0f;
            controlRotaryTime.ViewBar.OuterCircleRadius = 35.0f;
            iViewWidgetTime = new ViewWidgetTime(controlRotaryTime, viewHourGlass);

            iViewWidgetTimeButtons = new ViewWidgetTimeButtons("TimeButtons", null, iViewWidgetTime);
            iViewWidgetTimeButtons.RepeatInterval = 0.1f;

            iViewWidgetTimeRotary = new ViewWidgetTimeRotary("TimeRotary", null, iViewWidgetTime);

            iTimeController = new TimeControllerIpad(iViewWidgetTimeButtons, iViewWidgetTimeRotary, controlTime);
            iTimeController.SetRockers(helper.OptionEnableRocker.Native);
            viewController.SetTimeController(iTimeController);

            controlVolume.Hidden = false;
            controlTime.Hidden   = false;

            helper.OptionEnableRocker.EventValueChanged += delegate(object sender, EventArgs e) {
                iVolumeController.SetRockers(helper.OptionEnableRocker.Native);
                iTimeController.SetRockers(helper.OptionEnableRocker.Native);
            };

            Reachability.LocalWifiConnectionStatus();
            Reachability.ReachabilityChanged += delegate(object sender, EventArgs e) {
                helper.Helper.Interface.NetworkChanged();
            };

            new Action(delegate {
                Ticker ticker = new Ticker();

                iViewMaster = new ViewMaster();

                iHttpServer = new HttpServer(HttpServer.kPortKinskyTouch);
                iHttpClient = new HttpClient();

                iLibrary         = new MediaProviderLibrary(helper.Helper);
                iSharedPlaylists = new SharedPlaylists(helper.Helper);
                iLocalPlaylists  = new LocalPlaylists(helper.Helper, false);
                iLocalPlaylists.SaveDirectory.ResetToDefault();

                iConfigController = new ConfigControllerIpad(helper.Helper);
                iPlaySupport      = new PlaySupport();

                MediaProviderSupport support = new MediaProviderSupport(iHttpServer);
                PluginManager pluginManager  = new PluginManager(helper.Helper, iHttpClient, support);

                iLocator = new ContentDirectoryLocator(pluginManager, new AppRestartHandler());
                iLocator.Add(MediaProviderLibrary.kLibraryId, iLibrary);
                OptionBool optionSharedPlaylists = iLocator.Add(SharedPlaylists.kRootId, iSharedPlaylists);
                OptionBool optionLocalPlaylists  = iLocator.Add(LocalPlaylists.kRootId, iLocalPlaylists);

                iSaveSupport     = new SaveSupport(helper.Helper, iSharedPlaylists, optionSharedPlaylists, iLocalPlaylists, optionLocalPlaylists);
                iViewSaveSupport = new ViewSaveSupport(SavePlaylistHandler, iSaveSupport);

                helper.Helper.AddOptionPage(iLocator.OptionPage);

                InvokeOnMainThread(delegate {
                    AddViews();
                });

                iModel    = new Model(iViewMaster, iPlaySupport);
                iMediator = new Mediator(helper.Helper, iModel);

                OnFinishedLaunching();

                UserLog.WriteLine(string.Format("FinishedLaunching background tasks in {0} ms", ticker.MilliSeconds));
            }).BeginInvoke(null, null);

            Trace.Level = Trace.kKinskyTouch;

            // If you have defined a view, add it here:
            navigationController.View.Frame = new RectangleF(PointF.Empty, viewBrowser.Frame.Size);
            viewBrowser.InsertSubview(navigationController.View, 0);

            /*ArtworkTileViewFactory f = new ArtworkTileViewFactory(iLibrary);
             * NSBundle.MainBundle.LoadNib("ArtworkTileView", f, null);
             * viewController.View.AddSubview(f.View);
             * f.Initialise();*/

            window.RootViewController = viewController;

            window.MakeKeyAndVisible();

            UserLog.WriteLine(string.Format("FinishedLaunching in {0} ms", tick.MilliSeconds));

            return(true);
        }
Пример #10
0
        internal void InitialiseStack()
        {
            OptionPage generalOptionsPage = new OptionPage("General");

            iHideCursorOption = new OptionBool("hidecursor", "Hide Cursor", "Hide Cursor", false);
            generalOptionsPage.Add(iHideCursorOption);
            iRotaryControlsOption = new OptionBool("rotarycontrol", "Use rotary controls", "Use rotary controls", true);
            generalOptionsPage.Add(iRotaryControlsOption);
            iShowToolTipsOption = new OptionBool("tooltips", "Show tooltips", "Show tooltips", true);
            generalOptionsPage.Add(iShowToolTipsOption);
            iShowExtendedTrackInfoOption = new OptionBool("trackinfo", "Extended track info", "Show extended track information", true);
            generalOptionsPage.Add(iShowExtendedTrackInfoOption);
            iGroupPlaylistOption = new OptionBool("groupplaylist", "Group playlist items by album", "Allows grouping of items within the playlist window", false);
            generalOptionsPage.Add(iGroupPlaylistOption);
            iTransparentOption = new OptionBool("customwindow", "Transparent window (requires restart)", "Toggles custom window", true);
            generalOptionsPage.Add(iTransparentOption);
            iSoftwareRenderingOption = new OptionBool("softwarerendering", "Force software rendering (requires restart)", "Disables hardware rendering for troublesome display cards", false);
            generalOptionsPage.Add(iSoftwareRenderingOption);
            iHelper.AddOptionPage(generalOptionsPage);

            iOptionPageUpdates = new OptionPageUpdates(iHelper);
            iHelper.AddOptionPage(iOptionPageUpdates);



            OptionPage fontsOptionPage = new OptionPage("Fonts");

            iFontsOption = new OptionEnum("fontsize", "Font size", "Font size");
            iFontsOption.AddDefault(kFontOptionNormal);
            iFontsOption.Add(kFontOptionLarge);
            fontsOptionPage.Add(iFontsOption);

            iHideCursorOption.EventValueChanged            += OnOptionChanged;
            iRotaryControlsOption.EventValueChanged        += OnOptionChanged;
            iShowToolTipsOption.EventValueChanged          += OnOptionChanged;
            iShowExtendedTrackInfoOption.EventValueChanged += OnOptionChanged;
            iFontsOption.EventValueChanged              += OnOptionChanged;
            iTransparentOption.EventValueChanged        += OnOptionChanged;
            iOptionPageUpdates.EventBetaVersionsChanged += OnUpdatesChanged;
            iOptionPageUpdates.EventAutoUpdateChanged   += OnUpdatesChanged;

            iHelper.AddOptionPage(fontsOptionPage);

            iViewMaster = new ViewMaster();
            iHttpServer = new HttpServer(HttpServer.kPortKinskyDesktop);
            iHttpClient = new HttpClient();

            iLibrary         = new MediaProviderLibrary(iHelper);
            iSharedPlaylists = new SharedPlaylists(iHelper);
            iLocalPlaylists  = new LocalPlaylists(iHelper, true);

            iSupport = new MediaProviderSupport(iHttpServer);

            PluginManager pluginManager = new PluginManager(iHelper, iHttpClient, iSupport);

            iLocator = new ContentDirectoryLocator(pluginManager, new AppRestartHandler());
            OptionBool optionSharedPlaylists = iLocator.Add(SharedPlaylists.kRootId, iSharedPlaylists);
            OptionBool optionLocalPlaylists  = iLocator.Add(LocalPlaylists.kRootId, iLocalPlaylists);

            iLocator.Add(MediaProviderLibrary.kLibraryId, iLibrary);
            iHelper.AddOptionPage(iLocator.OptionPage);

            iSaveSupport     = new SaveSupport(iHelper, iSharedPlaylists, optionSharedPlaylists, iLocalPlaylists, optionLocalPlaylists);
            iViewSaveSupport = new ViewSaveSupport(RequestLocalPlaylistFilename, iSaveSupport);
            iPlaySupport     = new PlaySupport();

            iHelper.ProcessOptionsFileAndCommandLine();
            SetUpdateTypes();
        }
Пример #11
0
        internal void Initialise(KinskyDesktop aKinskyDesktop,
                                 HelperKinsky aHelperKinsky,
                                 ContentDirectoryLocator aLocator,
                                 IViewSaveSupport aSaveSupport,
                                 IPlaylistSupport aPlaylistSupport,
                                 DropConverter aBrowseDropConverter,
                                 DropConverter aViewDropConverter,
                                 ViewMaster aViewMaster,
                                 UiOptions aUIOptions,
                                 OptionBool aPlaylistGroupingOption,
                                 ModelSenders aSenders
                                 )
        {
            iHelperKinsky        = aHelperKinsky;
            iLocator             = aLocator;
            iBrowseDropConverter = aBrowseDropConverter;
            iViewMaster          = aViewMaster;
            iUIOptions           = aUIOptions;
            iSenders             = aSenders;
            iPlaylistSupport     = aPlaylistSupport;
            aPlaylistSupport.EventIsDraggingChanged += new EventHandler <EventArgs>(aPlaylistSupport_EventIsDraggingChanged);
            iViewDropConverter = aViewDropConverter;
            iBrowser           = new Browser(new Location(iLocator.Root));

            ViewWidgetButton upButtonWidgetBrowser = new ViewWidgetButton(buttonUpBrowser);

            breadcrumbBrowser.SetButtonUpDirectory(upButtonWidgetBrowser);

            iNavigationController = new NavigationController(iBrowser, iLocator, breadcrumbBrowser, iHelperKinsky);

            iBookmarks = new ViewWidgetBookmarks(iHelperKinsky,
                                                 iHelperKinsky.BookmarkManager,
                                                 lstBookmarks,
                                                 iBrowser,
                                                 popupBookmarksList,
                                                 popupAddBookmark,
                                                 buttonShowBookmarksList,
                                                 buttonShowAddBookmark,
                                                 buttonAddBookmark,
                                                 buttonCancelAddBookmark,
                                                 txtTitle,
                                                 txtBreadcrumb,
                                                 pnlAddBookmark,
                                                 iNavigationController);

            iBrowserWidget = new ViewWidgetBrowser(iPlaylistSupport,
                                                   iBrowseDropConverter,
                                                   buttonChangeSize,
                                                   buttonToggleListView,
                                                   iUIOptions,
                                                   sliderSize,
                                                   iNavigationController,
                                                   iBookmarks);
            pnlBrowser.Children.Add(iBrowserWidget);

            iRoomSelector = new ViewWidgetSelectorRoom(lstRooms, ctlSelectRoom, btnStandbyAll);
            IPlaylistWidget playlistMediaRenderer = new PlaylistWidget(aViewDropConverter, aPlaylistSupport, iUIOptions);
            IPlaylistWidget playlistRadio         = new PlaylistWidget(aViewDropConverter, aPlaylistSupport, iUIOptions);
            IPlaylistWidget playlistReceiver      = new PlaylistWidget(aViewDropConverter, aPlaylistSupport, iUIOptions);

            iViewWidgetPlaylistMediaRenderer = new ViewWidgetPlaylistMediaRenderer(pnlPlaylist, playlistMediaRenderer, aSaveSupport, aPlaylistSupport, aPlaylistGroupingOption.Native);
            iViewWidgetPlaylistRadio         = new ViewWidgetPlaylistRadio(pnlPlaylist, playlistRadio, aSaveSupport);
            iViewWidgetPlaylistAux           = new ViewWidgetPlaylistAux(pnlPlaylist);
            iViewWidgetPlaylistDiscPlayer    = new ViewWidgetPlaylistDiscPlayer(pnlPlaylist);
            iViewWidgetPlaylistReceiver      = new ViewWidgetPlaylistReceiver(pnlPlaylist, playlistReceiver, aSaveSupport, iSenders);

            iViewWidgetButtonStandby  = new ViewWidgetButtonStandby(this);
            iViewWidgetButtonSave     = new ViewWidgetButtonSave(buttonSave, aViewDropConverter, aSaveSupport);
            iViewWidgetButtonWasteBin = new ViewWidgetButtonWasteBin(buttonDelete, aViewDropConverter);

            iViewWidgetPlayMode = new ViewWidgetPlayMode(buttonRepeat, buttonShuffle);

            iViewWidgetTransportControl = new ViewWidgetTransportControl(aKinskyDesktop, threeKArray, aViewDropConverter, aPlaylistSupport);

            iViewWidgetPlayNowNextLater = new ViewWidgetPlayNowNextLater(aViewDropConverter, aPlaylistSupport, buttonPlayNow, buttonPlayNext, buttonPlayLater);

            iViewWidgetVolumeControl = new ViewWidgetVolumeControl(aKinskyDesktop, rotaryControlVolume, rockerControlVolume);
            iViewWidgetMediaTime     = new ViewWidgetMediaTime(rotaryControlMediaTime, rockerControlMediaTime);
            iViewWidgetTrack         = new ViewWidgetTrack(viewWidgetTrackDisplay, new IPlaylistWidget[] { playlistMediaRenderer, playlistRadio, playlistReceiver });
            SplitBarPositionLeft     = new GridLength(iUIOptions.BrowserSplitterLocationLeft, GridUnitType.Star);
            SplitBarPositionRight    = new GridLength(iUIOptions.BrowserSplitterLocationRight, GridUnitType.Star);
            iSourceSelector          = new ViewWidgetSelectorSource(lstSources, ctlSelectSource);

            iMediatorHouse = new MediatorHouse(iRoomSelector,
                                               iSourceSelector,
                                               pnlPlaylist,
                                               lstRooms,
                                               lstSources,
                                               buttonSelectRoom,
                                               buttonSelectSource,
                                               popupRoomSelection,
                                               popupSourceSelection,
                                               btnStandbyAll);;

            aPlaylistGroupingOption.EventValueChanged += (d, e) =>
            {
                iViewWidgetPlaylistMediaRenderer.SetGroupByAlbum(aPlaylistGroupingOption.Native);
            };

            iInitialised = true;
        }
Пример #12
0
        private void InitialiseStack()
        {
            iEventCreated.WaitOne();
            iEventLock       = new object();
            iUserLogListener = new AndroidUserLogListener();
            UserLog.AddListener(iUserLogListener);
            iTraceListener = new AndroidTraceListener();
            Trace.AddListener(iTraceListener);
            iInvoker         = new Invoker(this.ApplicationContext);
            iResourceManager = new AndroidResourceManager(this.Resources);
            iIconResolver    = new IconResolver(iResourceManager);
            iLayoutInflater  = (LayoutInflater)GetSystemService(Context.LayoutInflaterService);

            iHelperKinsky = new HelperKinsky(new string[2] {
                "-t", kTraceLevel
            }, Invoker);
            Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser += UnhandledExceptionRaiser;

            // name the crash dumper section general and add other UI options
            OptionPageCrashDumper generalOptions = new OptionPageCrashDumper("General");

            iOptionExtendedTrackInfo = new OptionBool("trackinfo", "Extended track info", "Show extended track information for the current track", true);
            generalOptions.Add(iOptionExtendedTrackInfo);
            iOptionEnableRocker = new OptionBool("rocker", "Button controls", "Enable button controls for controlling volume and seeking", false);
            generalOptions.Add(iOptionEnableRocker);
            iOptionGroupTracks = new OptionBool("groupplaylist", "Group playlist tracks", "Grouping tracks by album within the playlist window", true);
            generalOptions.Add(iOptionGroupTracks);

            iOptionAutoLock = new OptionEnum("autolock", "Prevent auto-lock", "When to prevent auto-lock");
            iOptionAutoLock.AddDefault(kAutoLockNever);
            iOptionAutoLock.Add(kAutoLockCharging);
            iOptionAutoLock.Add(kAutoLockAlways);
            generalOptions.Add(iOptionAutoLock);
            iOptionAutoLock.EventValueChanged += OptionAutoLock_EventValueChangedHandler;
            iHelperKinsky.AddOptionPage(generalOptions);

            iHelperKinsky.SetStackExtender(this);
            iCrashLogDumper = new CrashDumper(this.ApplicationContext, Resource.Drawable.Icon, iHelperKinsky, generalOptions);
            iHelperKinsky.AddCrashLogDumper(iCrashLogDumper);

            iOptionInsertMode = new OptionInsertMode();
            iHelperKinsky.AddOption(iOptionInsertMode);

            iViewMaster = new ViewMaster();
            iHttpServer = new HttpServer(HttpServer.kPortKinskyDroid);
            iHttpClient = new HttpClient();

            iLibrary         = new MediaProviderLibrary(iHelperKinsky);
            iSharedPlaylists = new SharedPlaylists(iHelperKinsky);
            iLocalPlaylists  = new LocalPlaylists(iHelperKinsky, false);

            PluginManager pluginManager = new PluginManager(iHelperKinsky, iHttpClient, new MediaProviderSupport(iHttpServer));

            iLocator = new ContentDirectoryLocator(pluginManager, new AppRestartHandler());

            OptionBool optionSharedPlaylists = iLocator.Add(SharedPlaylists.kRootId, iSharedPlaylists);
            OptionBool optionLocalPlaylists  = iLocator.Add(LocalPlaylists.kRootId, iLocalPlaylists);

            iLocator.Add(MediaProviderLibrary.kLibraryId, iLibrary);
            iHelperKinsky.AddOptionPage(iLocator.OptionPage);

            iSaveSupport = new SaveSupport(iHelperKinsky, iSharedPlaylists, optionSharedPlaylists, iLocalPlaylists, optionLocalPlaylists);
            iPlaySupport = new PlaySupport();
            iHelperKinsky.ProcessOptionsFileAndCommandLine();

            Linn.Kinsky.Model model = new Linn.Kinsky.Model(iViewMaster, iPlaySupport);
            iMediator = new Mediator(iHelperKinsky, model);

            iAndroidViewMaster = new AndroidViewMaster(this,
                                                       iViewMaster,
                                                       iInvoker,
                                                       iResourceManager,
                                                       iSaveSupport,
                                                       iIconResolver,
                                                       iOptionGroupTracks,
                                                       iOptionExtendedTrackInfo,
                                                       IsTabletView ? kMaxImageCacheSizeTablet : kMaxImageCacheSizePhone);

            iStackWatchdog = new System.Threading.Timer(StackWatchdogExpired);
            iPowerListener = new PowerStateListener(this.ApplicationContext);
            iPowerListener.EventPowerStateChanged += EventPowerStateChangedHandler;

            iIsCharging  = PowerStateListener.IsConnected(this.ApplicationContext);
            iRescanTimer = new System.Threading.Timer((e) =>
            {
                Rescan();
            });
            iRescanTimer.Change(Timeout.Infinite, Timeout.Infinite);
            SetAutoLock();
            EventLowMemory += EventLowMemoryHandler;
            iInitialised    = true;
            StartStack();
        }
Пример #13
0
 public void Initialise(ViewMaster aViewMaster)
 {
     iViewMaster             = aViewMaster;
     iViewSysTrayContextMenu = new ViewSysTrayContextMenu(this);
 }