Exemplo n.º 1
0
 //-------------------------------------------------------------------------
 public override void load(EbPropSet prop_set)
 {
     Name = prop_set.getPropString("T_Name").get();
     var prop_state = prop_set.getPropInt("I_State");
     State = prop_state == null ? DataState.Default : (DataState)prop_state.get();
     AudioName = prop_set.getPropString("T_AudioName").get();
     LoopType = (AudioLoopTypeEnum)prop_set.getPropInt("I_LoopType").get();
     AudioType = (AudioTypeEnum)prop_set.getPropInt("I_AudioType").get();
 }
Exemplo n.º 2
0
        //-------------------------------------------------------------------------
        public override void load(EbPropSet prop_set)
        {
            Name = prop_set.getPropString("T_Name").get();
            var prop_state = prop_set.getPropInt("I_State");

            State     = prop_state == null ? DataState.Default : (DataState)prop_state.get();
            AudioName = prop_set.getPropString("T_AudioName").get();
            LoopType  = (AudioLoopTypeEnum)prop_set.getPropInt("I_LoopType").get();
            AudioType = (AudioTypeEnum)prop_set.getPropInt("I_AudioType").get();
        }
Exemplo n.º 3
0
        private FileResource GenerateFullBookArchive(List <TrackRecordingData> recordings, BookData bookData, AudioTypeEnum audioType,
                                                     ResourceSessionDirector resourceSessionDirector)
        {
            var archiveName = GetArchiveName(bookData, audioType);
            var fullPath    = Path.Combine(resourceSessionDirector.SessionPath, archiveName);

            using (var fs = new FileStream(fullPath, FileMode.Create))
            {
                using (var zipFile = new ZipArchive(fs, ZipArchiveMode.Create))
                {
                    foreach (var record in recordings)
                    {
                        var sessionResource = resourceSessionDirector.GetResourceFromSession(ResourceType.Audio, record.FileName);
                        if (sessionResource != null)
                        {
                            zipFile.CreateEntryFromFile(sessionResource.FullPath, record.FileName, CompressionLevel.Optimal);
                        }
                        else
                        {
                            if (m_log.IsErrorEnabled)
                            {
                                m_log.ErrorFormat($"Found metadata info about audioFileRecord : {record.FileName} but file was not uploaded to session.");
                            }
                        }
                    }
                }
            }

            return(new FileResource
            {
                FileName = archiveName,
                FullPath = fullPath,
                ResourceType = ResourceType.Audio,
            });
        }
Exemplo n.º 4
0
 private string GetArchiveName(BookData bookData, AudioTypeEnum audioType)
 {
     return(string.Format("{0}_{1}.zip", bookData.VersionXmlId, audioType));
 }