Exemplo n.º 1
0
        public override void Parse(string sFileGroupPre, bool bListFoldersToo, bool bReverseOrder)
        {
            Clear();

            RscStore store = new RscStore();

            if (bListFoldersToo)
            {
                string[]           fldrsAll = RscSort.OrderBy(store.GetFolderNames(FullPath, "*.*"), bReverseOrder);
                RscStoreItemFolder oFolder;
                foreach (string fldr in fldrsAll)
                {
                    oFolder = new RscStoreItemFolder(fldr);
                    AddItem(oFolder);
                }
            }

            string[] flesAll = RscSort.OrderBy(store.GetFileNames(FullPath, "*.*"), bReverseOrder);

            int              iPos;
            string           sExt;
            string           sFileGroup;
            RscStoreItemFile oFile;

            foreach (string fle in flesAll)
            {
                iPos = fle.LastIndexOf('.');
                if (iPos >= 0)
                {
                    sExt       = fle.Substring(iPos);
                    sFileGroup = RscRegFs.GetFileGroupEx(sExt);
                    if (sFileGroupPre.Length == 0 || sFileGroup.IndexOf(sFileGroupPre) == 0)
                    {
                        oFile = new RscStoreItemFile(fle.Substring(0, iPos), sExt, sFileGroup);
                        AddItem(oFile);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void m_Image_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (m_bIsInSwipe)
            {
                return;
            }
            m_bIsInSwipe = false;

            Button btn = (Button)sender;
            string sId = (string)btn.Tag;

            string [] asID   = sId.Split('|');
            int       iYcurr = Int32.Parse(asID[0]);
            int       iXcurr = Int32.Parse(asID[1]);

            if (m_a[iYcurr].m_a[iXcurr].FsItem.Folder)
            {
                m_iTop = 0;

                m_iYCur = -1;
                m_iXCur = -1;

                m_Root = m_a[iYcurr].m_a[iXcurr].FsItem;

                m_btnUp.Visibility = Rsc.Visible;

                BuildListEx();
            }
            else
            {
                m_iYCur = iYcurr;
                m_iXCur = iXcurr;

                string strFileGroupCurr = RscRegFs.GetFileGroupEx(m_a[iYcurr].m_a[iXcurr].FsItem.FileExt);
                switch (strFileGroupCurr)
                {
                case "Video.Native":
                case "Video":
                {
                    RscPageArgsRetManager appArgs = new RscPageArgsRetManager();

                    RscPageArgsRet appInput = new RscPageArgsRet(appArgs,
                                                                 m_AppFrame.AppTitle, m_AppFrame.AppIconRes, "Open");

                    //DeBug...
                    //m_AppFrame.TRACE = m_a.Count.ToString();

                    int iIdx = 0;
                    int i    = -1;
                    for (int iY = 0; iY < m_a.Count; iY++)
                    {
                        for (int iX = 0; iX < m_iCX; iX++)
                        {
                            if (m_a[iY].m_a[iX].Name != "blank")
                            {
                                string strFileGroup = RscRegFs.GetFileGroupEx(m_a[iY].m_a[iX].FsItem.FileExt);
                                switch (strFileGroup)
                                {
                                case "Video.Native":
                                {
                                    i++;
                                    appInput.SetData(i, m_a[iY].m_a[iX].FsItem.FullPath);

                                    if (iY == iYcurr && iX == iXcurr)
                                    {
                                        iIdx = i;
                                    }

                                    break;
                                }
                                }
                            }
                        }
                    }

                    appInput.SetFlag(0, iIdx.ToString());
                    appInput.SetFlag(1, LayoutRoot.ActualWidth.ToString());
                    appInput.SetFlag(2, LayoutRoot.ActualHeight.ToString());

                    appInput.SetInput(RscRegFs.GetViewerAppPageName(strFileGroupCurr));

                    this.NavigationService.Navigate(appInput.GetNavigateUri(RscRegFs.GetViewerAppAssyName(strFileGroupCurr)));

                    break;
                }

                default:
                    MessageBox.Show("No open action defined for file type.");
                    break;
                }
            }

            /*
             * if( m_a[ iYcurr ].m_a[ iXcurr ].Checked )
             * {
             *      MassCheck( iYcurr, iYcurr, iXcurr, iXcurr, false );
             * }
             * else
             * {
             *      MassCheck( iYcurr, iYcurr, iXcurr, iXcurr, true );
             * }
             */
        }
Exemplo n.º 3
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (m_AppArgs.Waiting)
            {
                RscPageArgsRet appOutput = m_AppArgs.GetOutput();
                if (appOutput != null)
                {
                    switch (appOutput.ID)
                    {
                    case "SndFldrPath":
                        if (appOutput.GetFlag(0) == "Ok")
                        {
                            string sFolderIn = appOutput.GetData(0);

                            m_siInPlayer = null;
                            ClearAllSound();

                            RscStore store = new RscStore();

                            string[] fles = RscSort.OrderBy(store.GetFileNames(sFolderIn, "*.*"));
                            foreach (string sFle in fles)
                            {
                                string sExt = RscStore.ExtensionOfPath(sFle);

                                // FIX: To support Tube(HD)'s own local storage Video folder
                                //      where files are listed without extension!!!
                                bool bInclude = (sExt == "");

                                string strFileGroup = RscRegFs.GetFileGroupEx(sExt);
                                switch (strFileGroup)
                                {
                                case "Sound.Native":
                                case "Video.Native":
                                {
                                    bInclude = true;
                                    break;
                                }
                                }

                                if (bInclude)
                                {
                                    SoundInfo si = AddSound(sFolderIn + "\\" + sFle);
                                    if (m_siInPlayer == null)
                                    {
                                        m_siInPlayer = si;
                                    }
                                }
                            }

                            if (m_siInPlayer != null)
                            {
                                DoPlay();
                            }

                            RscRegistry.WriteString(HKEY.HKEY_CURRENT_USER, "Software\\Ressive.Hu\\RscViewer_SoundV11"
                                                    , "LastOk", sFolderIn);
                        }
                        else
                        {
                            //NOP...
                        }
                        break;
                    }
                }

                m_AppArgs.Clear();
            }
        }
Exemplo n.º 4
0
        private void RscViewer_SoundV10_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            m_AppFrame.SetNoSleep(true);

            if (m_bLoaded)
            {
                return;
            }
            m_bLoaded = true;

            m_currentPosition.Tick += new System.EventHandler(m_currentPosition_Tick);

            RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();

            appInput = appArgsMgr.GetInput(csPageName);

            if (appInput != null)
            {
                m_AppFrame.AppTitle   = appInput.CallerAppTitle;
                m_AppFrame.AppIconRes = appInput.CallerAppIconRes;

                int iIndex = 0;
                if (!Int32.TryParse(appInput.GetFlag(0), out iIndex))
                {
                    return;
                }

                //NOT NEEDED...

                /*
                 * if( !double.TryParse( appInput.GetFlag(1), out dWidth ) ) return;
                 * if( !double.TryParse( appInput.GetFlag(2), out dHeight ) ) return;
                 */

                m_siInPlayer = null;
                ClearAllSound();

                for (int i = 0; i < appInput.DataCount; i++)
                {
                    SoundInfo si = AddSound(appInput.GetData(i));
                    if (i == iIndex)
                    {
                        m_siInPlayer = si;
                    }
                }

                if (m_siInPlayer != null)
                {
                    DoPlay();
                }

                //Denie to auto-reload on next start...
                appArgsMgr.Vipe();
            }
            else
            {
                string sLastOk = RscRegistry.ReadString(HKEY.HKEY_CURRENT_USER, "Software\\Ressive.Hu\\RscViewer_SoundV11"
                                                        , "LastOk", "");
                if (sLastOk.Length > 0)
                {
                    try
                    {
                        m_siInPlayer = null;

                        //DO NOT!!!
                        //ClearAllSound();

                        RscStore store = new RscStore();

                        string[] fles = RscSort.OrderBy(store.GetFileNames(sLastOk, "*.*"));
                        foreach (string sFle in fles)
                        {
                            string sExt = RscStore.ExtensionOfPath(sFle);

                            // FIX: To support Tube(HD)'s own local storage Video folder
                            //      where files are listed without extension!!!
                            bool bInclude = (sExt == "");

                            string strFileGroup = RscRegFs.GetFileGroupEx(sExt);
                            switch (strFileGroup)
                            {
                            case "Sound.Native":
                            case "Video.Native":
                            {
                                bInclude = true;
                                break;
                            }
                            }

                            if (bInclude)
                            {
                                SoundInfo si = AddSound(sLastOk + "\\" + sFle);
                                if (m_siInPlayer == null)
                                {
                                    m_siInPlayer = si;
                                }
                            }
                        }

                        //DO NOT!!!

                        /*
                         * if( m_siInPlayer != null )
                         * {
                         *      DoPlay();
                         * }
                         */
                    }
                    catch (Exception)
                    {
                    }
                }
            }
        }