本文整理汇总了C++中CSL函数的典型用法代码示例。如果您正苦于以下问题:C++ CSL函数的具体用法?C++ CSL怎么用?C++ CSL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CSL函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CSL
void MediaInfo_Config_MediaInfo::Event_Send (const int8u* Data_Content, size_t Data_Size, const Ztring &File_Name)
{
CriticalSectionLocker CSL(CS);
if (Event_CallBackFunction)
Event_CallBackFunction ((unsigned char*)Data_Content, Data_Size, Event_UserHandler);
else
{
MediaInfo_Event_Generic* Event_Generic=(MediaInfo_Event_Generic*)Data_Content;
if ((Event_Generic->EventCode&0x00FFFF00)==(MediaInfo_Event_Global_Demux<<8))
{
if (!MediaInfoLib::Config.Demux_Get())
return;
if (File_Name.empty())
return;
MediaInfo_Event_Global_Demux_0* Event=(MediaInfo_Event_Global_Demux_0*)Data_Content;
Ztring File_Name_Final(File_Name);
for (size_t Pos=0; Pos<Event->StreamIDs_Size; Pos++)
File_Name_Final+=_T(".")+Ztring().From_Number(Event->StreamIDs[Pos], 16);
File_Name_Final+=_T(".raw");
File F;
F.Open(File_Name_Final, File::Access_Write_Append);
F.Write(Event->Content, Event->Content_Size);
}
}
}
示例2: while
//---------------------------------------------------------------------------
String MediaInfoList_Internal::Inform(size_t FilePos, size_t)
{
if (FilePos==Error)
{
Ztring Retour;
unsigned int FilePos=0;
ZtringListList MediaInfo_Custom_View; MediaInfo_Custom_View.Write(Option(_T("Inform_Get")));
Retour+=MediaInfo_Custom_View(Stream_Max+2, 1);//Page_Begin
while (FilePos<Info.size())
{
Retour+=Inform(FilePos);
if (FilePos<Info.size()-1)
Retour+=MediaInfo_Custom_View(Stream_Max+3, 1);//Page_Middle
FilePos++;
}
Retour+=MediaInfo_Custom_View(Stream_Max+4, 1);//Page_End
//Retour.FindAndReplace(_T("\\n"),_T( "\n"), 0, Ztring_Recursive);
return Retour.c_str();
}
CriticalSectionLocker CSL(CS);
if (FilePos>=Info.size() || Info[FilePos]==NULL || Info[FilePos]->Count_Get(Stream_General)==0)
return MediaInfoLib::Config.EmptyString_Get();
return Info[FilePos]->Inform();
}
示例3: while
//---------------------------------------------------------------------------
String MediaInfoList_Internal::Inform(size_t FilePos, size_t)
{
if (FilePos==Error)
{
Ztring Retour;
FilePos=0;
ZtringListList MediaInfo_Custom_View; MediaInfo_Custom_View.Write(Option(_T("Inform_Get")));
bool XML=false;
if (MediaInfoLib::Config.Inform_Get()==_T("XML"))
XML=true;
if (XML) Retour+=_T("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")+MediaInfoLib::Config.LineSeparator_Get()+_T("<Mediainfo version=\"")+MediaInfoLib::Config.Info_Version_Get().SubString(_T(" v"), Ztring())+_T("\">")+MediaInfoLib::Config.LineSeparator_Get();
else
Retour+=MediaInfo_Custom_View("Page_Begin");
while (FilePos<Info.size())
{
Retour+=Inform(FilePos);
if (FilePos<Info.size()-1)
{
Retour+=MediaInfo_Custom_View("Page_Middle");
}
FilePos++;
}
if (XML) Retour+=_T("</Mediainfo>")+MediaInfoLib::Config.LineSeparator_Get();
else Retour+=MediaInfo_Custom_View("Page_End");//
return Retour.c_str();
}
CriticalSectionLocker CSL(CS);
if (FilePos>=Info.size() || Info[FilePos]==NULL || Info[FilePos]->Count_Get(Stream_General)==0)
return MediaInfoLib::Config.EmptyString_Get();
return Info[FilePos]->Inform();
}
示例4: while
//---------------------------------------------------------------------------
String MediaInfoList_Internal::Inform(size_t FilePos, size_t)
{
if (FilePos==Error)
{
Ztring Retour;
FilePos=0;
ZtringListList MediaInfo_Custom_View; MediaInfo_Custom_View.Write(Option(_T("Inform_Get")));
bool XML=false;
if (MediaInfoLib::Config.Inform_Get()==_T("XML"))
XML=true;
if (XML) Retour+=_T("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Mediainfo>\n");
else Retour+=MediaInfo_Custom_View(Stream_Max+2, 1);//Page_Begin
while (FilePos<Info.size())
{
Retour+=Inform(FilePos);
if (FilePos<Info.size()-1)
{
Retour+=MediaInfo_Custom_View(Stream_Max+3, 1);//Page_Middle
}
FilePos++;
}
if (XML) Retour+=_T("</Mediainfo>\n");
else Retour+=MediaInfo_Custom_View(Stream_Max+4, 1);//Page_End
//Retour.FindAndReplace(_T("\\n"),_T( "\n"), 0, Ztring_Recursive);
return Retour.c_str();
}
CriticalSectionLocker CSL(CS);
if (FilePos>=Info.size() || Info[FilePos]==NULL || Info[FilePos]->Count_Get(Stream_General)==0)
return MediaInfoLib::Config.EmptyString_Get();
return Info[FilePos]->Inform();
}
示例5: CSL
//---------------------------------------------------------------------------
String MediaInfoList_Internal::Option (const String &Option, const String &Value)
{
CriticalSectionLocker CSL(CS);
Ztring OptionLower=Option; OptionLower.MakeLowerCase();
if (Option==_T(""))
return _T("");
else if (OptionLower==_T("manguage_update"))
{
//Special case : Language_Update must update all MediaInfo classes
for (unsigned int Pos=0; Pos<Info.size(); Pos++)
if (Info[Pos])
Info[Pos]->Option(_T("language_update"), Value);
return _T("");
}
else if (OptionLower==_T("create_dummy"))
{
Info.resize(Info.size()+1);
Info[Info.size()-1]=new MediaInfo();
Info[Info.size()-1]->Option(Option, Value);
return _T("");
}
else if (OptionLower==_T("thread"))
{
BlockMethod=1;
return _T("");
}
else if (OptionLower.find(_T("file_"))==0)
{
Config_MediaInfo_Items[Option]=Value;
return _T("");
}
else
return MediaInfo::Option_Static(Option, Value);
}
示例6: RequestTerminate
//---------------------------------------------------------------------------
void MediaInfoList_Internal::Close(size_t FilePos)
{
if (IsRunning())
{
RequestTerminate();
while(IsExited())
Yield();
}
CriticalSectionLocker CSL(CS);
if (FilePos==Unlimited)
{
for (size_t Pos=0; Pos<Info.size(); Pos++)
{
delete Info[Pos]; Info[Pos]=NULL;
}
Info.clear();
}
else if (FilePos<Info.size())
{
delete Info[FilePos]; Info[FilePos]=NULL;
Info.erase(Info.begin()+FilePos);
}
ToParse_AlreadyDone=0;
ToParse_Total=0;
}
示例7: Write
static INLINE void Write(unsigned char reg, unsigned char value)
{
CSL();
SPI_BYTE(reg);
SPI_BYTE(value);
CSH();
}
示例8: CSL
//---------------------------------------------------------------------------
size_t MediaInfo_Internal::Open_Buffer_Init (int64u File_Size_, int64u File_Offset_)
{
CriticalSectionLocker CSL(CS);
if (Info==NULL)
{
if (!Config.File_ForceParser_Get().empty())
{
SelectFromExtension(Config.File_ForceParser_Get());
MultipleParsing_IsDetected=true;
}
else
Info=new File__MultipleParsing;
}
#ifndef MEDIAINFO_MINIMIZESIZE
Info->Init(&Config, &Details, &Stream, &Stream_More);
#else //MEDIAINFO_MINIMIZESIZE
Info->Init(&Config, &Stream, &Stream_More);
#endif //MEDIAINFO_MINIMIZESIZE
Info->Open_Buffer_Init(File_Size_, File_Offset_);
//Saving the real file size, in case the user provide the theoritical file size, to be used instead of the real file size
File_Size=File_Size_;
return 1;
}
示例9: CSL
Ztring MediaInfo_Config_PerPackage::Event_CallBackFunction_Set (const Ztring &Value)
{
ZtringList List=Value;
CriticalSectionLocker CSL(CS);
if (List.empty())
{
Event_CallBackFunction=(MediaInfo_Event_CallBackFunction*)NULL;
Event_UserHandler=NULL;
}
else
for (size_t Pos=0; Pos<List.size(); Pos++)
{
if (List[Pos].find(__T("CallBack=memory://"))==0)
Event_CallBackFunction=(MediaInfo_Event_CallBackFunction*)Ztring(List[Pos].substr(18, std::string::npos)).To_int64u();
else if (List[Pos].find(__T("UserHandle=memory://"))==0)
Event_UserHandler=(void*)Ztring(List[Pos].substr(20, std::string::npos)).To_int64u();
else if (List[Pos].find(__T("UserHandler=memory://"))==0)
Event_UserHandler=(void*)Ztring(List[Pos].substr(21, std::string::npos)).To_int64u();
else
return("Problem during Event_CallBackFunction value parsing");
}
return Ztring();
}
示例10: Close
//---------------------------------------------------------------------------
//Destructeur
MediaInfoList_Internal::~MediaInfoList_Internal()
{
Close();
CriticalSectionLocker CSL(CS);
for (size_t Pos=0; Pos<Info.size(); Pos++)
delete Info[Pos]; //Info[Pos]=NULL;
}
示例11: Close
//---------------------------------------------------------------------------
MediaInfo_Internal::~MediaInfo_Internal()
{
Close();
CriticalSectionLocker CSL(CS);;
delete Info; //Info=NULL;
delete[] Buffer; //Buffer=NULL;
delete (File*)File_Handle; //File_Handle=NULL;
}
示例12: Read
static INLINE unsigned char Read(unsigned char reg)
{
unsigned char value;
CSL();
SPI_BYTE(reg);
value = SPI_BYTE(0xFF);
CSH();
return value;
}
示例13: MediaInfo
//---------------------------------------------------------------------------
size_t MediaInfoList_Internal::Open_Buffer_Init (int64u File_Size_, int64u File_Offset_)
{
MediaInfo* MI=new MediaInfo();
MI->Open_Buffer_Init(File_Size_, File_Offset_);
CriticalSectionLocker CSL(CS);
size_t Pos=Info.size();
Info.push_back(MI);
return Pos;
}