1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
// GUI_Main_Common_Core - Core GUI for MediaInfo
// Copyright (C) 2007-2012 MediaArea.net SARL, Info@MediaArea.net
//
// This library is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library. If not, see <http://www.gnu.org/licenses/>.
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//---------------------------------------------------------------------------
#include "GUI/Common/GUI_Main_Common_Core.h"
#include "Common/Core.h"
//---------------------------------------------------------------------------
//***************************************************************************
// Constructor/Destructor
//***************************************************************************
//---------------------------------------------------------------------------
GUI_Main_Common_Core::GUI_Main_Common_Core(Core* _C)
{
//Internal
C=_C;
File_Pos=(size_t)-1;
}
//***************************************************************************
// Actions - Global
//***************************************************************************
//---------------------------------------------------------------------------
size_t GUI_Main_Common_Core::FilesCount_Get()
{
return C->MI->Count_Get();
}
//---------------------------------------------------------------------------
size_t GUI_Main_Common_Core::FilesPos_Get()
{
return File_Pos;
}
//***************************************************************************
// Actions - Per file
//***************************************************************************
//---------------------------------------------------------------------------
String GUI_Main_Common_Core::FileName_Get()
{
return C->MI->Get(File_Pos, Stream_General, 0, _T("CompleteName")).c_str();
}
//***************************************************************************
// Actions - Per StreamKind
//***************************************************************************
//---------------------------------------------------------------------------
size_t GUI_Main_Common_Core::StreamsCount_Get(stream_t StreamKind)
{
return C->MI->Count_Get(File_Pos, StreamKind);
}
//***************************************************************************
// Actions - Per Stream
//***************************************************************************
//---------------------------------------------------------------------------
String GUI_Main_Common_Core::Summary_Get(stream_t StreamKind, size_t StreamPos)
{
C->MI->Option(_T("Inform"), _T("Summary"));
return C->MI->Get(File_Pos, StreamKind, StreamPos, _T("Inform")).c_str();
}
//---------------------------------------------------------------------------
String GUI_Main_Common_Core::Inform_Get(stream_t StreamKind, size_t StreamPos)
{
C->MI->Option(_T("Inform"), _T(""));
return C->MI->Get(File_Pos, StreamKind, StreamPos, _T("Inform")).c_str();
}
//---------------------------------------------------------------------------
String GUI_Main_Common_Core::CodecID_Url_Get(stream_t StreamKind, size_t StreamPos)
{
if (!C->MI->Get(File_Pos, StreamKind, StreamPos, _T("CodecID/Url")).empty())
return C->MI->Get(File_Pos, StreamKind, StreamPos, _T("CodecID/Url")).c_str();
else
return C->MI->Get(File_Pos, StreamKind, StreamPos, _T("Format/Url")).c_str();
}
|