Skip to content

Commit

Permalink
EPG自動予約に無効スイッチを付加した。
Browse files Browse the repository at this point in the history
  • Loading branch information
Velmy committed Jan 8, 2014
1 parent ad28b66 commit 5b7e532
Show file tree
Hide file tree
Showing 13 changed files with 200 additions and 3 deletions.
10 changes: 10 additions & 0 deletions Common/CtrlCmdUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4780,6 +4780,7 @@ DWORD GetVALUESize( EPG_AUTO_ADD_DATA* val )
size += GetVALUESize(val->dataID);
size += GetVALUESize(&val->searchInfo);
size += GetVALUESize(&val->recSetting);
size += GetVALUESize(val->DisableSw);

return size;
}
Expand Down Expand Up @@ -4811,6 +4812,10 @@ BOOL WriteVALUE( EPG_AUTO_ADD_DATA* val, BYTE* buff, DWORD buffSize, DWORD* writ
return FALSE;
}
pos += size;
if( WriteVALUE( val->DisableSw, buff + pos, buffSize - pos, &size ) == FALSE ){
return FALSE;
}
pos += size;
}

if( writeSize != NULL ){
Expand Down Expand Up @@ -4849,6 +4854,10 @@ BOOL ReadVALUE( EPG_AUTO_ADD_DATA* val, BYTE* buff, DWORD buffSize, DWORD* readS
return FALSE;
}
pos += size;
if( ReadVALUE( &val->DisableSw, buff + pos, buffSize - pos, &size ) == FALSE ){
return FALSE;
}
pos += size;
}

if( readSize != NULL ){
Expand Down Expand Up @@ -7212,6 +7221,7 @@ void CopyOldNew(OLD_SEARCH_KEY* src, EPG_AUTO_ADD_DATA* dest)
dest->recSetting.continueRecFlag = 0;
dest->recSetting.partialRecFlag = 0;
dest->recSetting.tunerID = 0;
dest->DisableSw = false;
if( src->strRecFolder.size() > 0 ){
REC_FILE_SET_INFO folder;
folder.recFolder = src->strRecFolder;
Expand Down
11 changes: 10 additions & 1 deletion Common/CtrlCmdUtil2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2445,6 +2445,7 @@ DWORD GetVALUESize2(WORD ver, EPG_AUTO_ADD_DATA* val )
size += GetVALUESize2(ver,val->dataID);
size += GetVALUESize2(ver,&val->searchInfo);
size += GetVALUESize2(ver,&val->recSetting);
size += GetVALUESize2(ver,val->DisableSw);

if( ver<=4 ){
goto CMD_END;
Expand Down Expand Up @@ -2487,6 +2488,10 @@ BOOL WriteVALUE2(WORD ver, EPG_AUTO_ADD_DATA* val, BYTE* buff, DWORD buffSize, D
return FALSE;
}
pos += size;
if( WriteVALUE2(ver, val->DisableSw, buff + pos, buffSize - pos, &size ) == FALSE ){
return FALSE;
}
pos += size;

if( ver<=4 ){
goto CMD_END;
Expand Down Expand Up @@ -2539,6 +2544,10 @@ BOOL ReadVALUE2(WORD ver, EPG_AUTO_ADD_DATA* val, BYTE* buff, DWORD buffSize, DW
return FALSE;
}
pos += size;
if( ReadVALUE2(ver, &val->DisableSw, buff + pos, buffSize - pos, &size ) == FALSE ){
return FALSE;
}
pos += size;

if( ver<=4 ){
goto CMD_END;
Expand Down Expand Up @@ -2583,7 +2592,7 @@ BOOL WriteVALUE2(WORD ver, vector<EPG_AUTO_ADD_DATA>* val, BYTE* buff, DWORD buf
return FALSE;
}

//まず全体のサイズ
//まず全体のサイズ ------------
DWORD pos = 0;
DWORD size = 0;
if( WriteVALUE2(ver, valSize, buff + pos, buffSize - pos, &size ) == FALSE ){
Expand Down
17 changes: 17 additions & 0 deletions Common/ParseEpgAutoAddText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,15 @@ BOOL CParseEpgAutoAddText::Parse1Line(string parseLine, EPG_AUTO_ADD_DATA* item

Separate( parseLine, "\t", strBuff, parseLine);

//無効
if( (WORD)atoi(strBuff.c_str()) == 1 ){
item->DisableSw = true;
} else {
item->DisableSw = false;
}

Separate( parseLine, "\t", strBuff, parseLine);

return TRUE;
}

Expand Down Expand Up @@ -626,6 +635,14 @@ BOOL CParseEpgAutoAddText::SaveText(LPCWSTR filePath)
Format(strBuff,"%d",itr->second->searchInfo.chkRecMin);
strWrite+=strBuff +"\t";

//無効スイッチ
if( itr->second->DisableSw == true ){
strBuff = "1";
} else {
strBuff = "0";
}
strWrite+=strBuff +"\t";

strWrite+="\r\n";
WriteFile(hFile, strWrite.c_str(), (DWORD)strWrite.length(), &dwWrite, NULL);
}
Expand Down
3 changes: 3 additions & 0 deletions Common/StructDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,14 @@ typedef struct _EPG_AUTO_ADD_DATA{
EPGDB_SEARCH_KEY_INFO searchInfo; //検索キー
REC_SETTING_DATA recSetting; //録画設定
DWORD addCount; //予約登録数
WORD DisableSw; //無効

_EPG_AUTO_ADD_DATA & operator= (const _EPG_AUTO_ADD_DATA & o) {
dataID = o.dataID;
searchInfo = o.searchInfo;
recSetting = o.recSetting;
addCount = o.addCount;
DisableSw = o.DisableSw;
return *this;
};
} EPG_AUTO_ADD_DATA;
Expand Down
3 changes: 2 additions & 1 deletion CtrlCmdCLI/CtrlCmdCLI/CtrlCmdCLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ void CtrlCmdUtil::CopyData(Def::EpgAutoAddData^ src, EPG_AUTO_ADD_DATA* dest)
CopyData(src->searchInfo, &dest->searchInfo);
CopyData(src->recSetting, &dest->recSetting);
dest->addCount = src->addCount;
dest->DisableSw = src->DisableSw;
}

void CtrlCmdUtil::CopyData(EPG_AUTO_ADD_DATA* src, Def::EpgAutoAddData^% dest)
Expand All @@ -915,7 +916,7 @@ void CtrlCmdUtil::CopyData(EPG_AUTO_ADD_DATA* src, Def::EpgAutoAddData^% dest)
CopyData(&src->searchInfo, dest->searchInfo);
CopyData(&src->recSetting, dest->recSetting);
dest->addCount = src->addCount;

dest->DisableSw = src->DisableSw;
}

void CtrlCmdUtil::CopyData(Def::ManualAutoAddData^ src, MANUAL_AUTO_ADD_DATA* dest)
Expand Down
10 changes: 10 additions & 0 deletions CtrlCmdCLI/CtrlCmdCLI/CtrlCmdCLIDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -922,12 +922,17 @@ namespace Def {
/// 予約登録数
/// </summary>
property UInt32 addCount;
/// <summary>
/// 無効フラグ(0:有効 1:無効
/// </summary>
property WORD DisableSw;
public:
EpgAutoAddData(void){
dataID = 0;
searchInfo = gcnew EpgSearchKeyInfo();
recSetting = gcnew RecSettingData();
addCount = 0;
DisableSw = 0;
};
};

Expand Down Expand Up @@ -976,6 +981,10 @@ namespace Def {
/// 録画設定
/// </summary>
property RecSettingData^ recSetting;
/// <summary>
/// 無効フラグ(0:有効 1:無効
/// </summary>
property WORD DisableSw;
public:
ManualAutoAddData(void){
dataID = 0;
Expand All @@ -987,6 +996,7 @@ namespace Def {
originalNetworkID = 0;
transportStreamID = 0;
serviceID = 0;
DisableSw = 0;

recSetting = gcnew RecSettingData();
};
Expand Down
32 changes: 32 additions & 0 deletions EpgTimer/EpgTimer/DefineClass/EpgAutoDataItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,26 @@ public String Pittari
}
}

public String Disabled
{
get
{
String view = "";
if (EpgAutoAddInfo != null)
{
if (EpgAutoAddInfo.DisableSw == 0)
{
view = "有効";
}
else if (EpgAutoAddInfo.DisableSw == 1)
{
view = "無効";
}
}
return view;
}
}

public TextBlock ToolTipView
{
get
Expand Down Expand Up @@ -611,6 +631,18 @@ public Brush BorderBrush
return color1;
}
}
public SolidColorBrush BackColor
{
get
{
SolidColorBrush color = CommonManager.Instance.ResDefBackColor;
if (EpgAutoAddInfo.DisableSw == 1)
{
color = CommonManager.Instance.ResNoBackColor;
}
return color;
}
}

}
}
2 changes: 1 addition & 1 deletion EpgTimer/EpgTimer/ReserveView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="130" />
</Grid.ColumnDefinitions>
<ListView Name="listView_reserve" Margin="10" SelectionMode="Extended" ItemsSource="{Binding}" GridViewColumnHeader.Click="GridViewColumnHeader_Click" ContextMenu="{DynamicResource itemHeader}" ContextMenuOpening="ContextMenu_Header_ContextMenuOpening">
<ListView Name="listView_reserve" Margin="10" SelectionMode="Extended" ItemsSource="{Binding}" GridViewColumnHeader.Click="GridViewColumnHeader_Click" ContextMenu="{DynamicResource itemHeader}" ContextMenuOpening="ContextMenu_Header_ContextMenuOpening" Background="White">
<ListView.Resources>
<Style TargetType="ListViewItem">
<Setter Property="ToolTipService.ShowDuration" Value="20000" />
Expand Down
1 change: 1 addition & 0 deletions EpgTimer/EpgTimer/SearchWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@
</GridView>
</ListView.View>
</ListView>
<CheckBox Content="無効" Height="16" HorizontalAlignment="Left" Margin="652,0,0,8" Name="checkBox_Disable" VerticalAlignment="Bottom" Grid.Row="1" />
</Grid>
</Window>
18 changes: 18 additions & 0 deletions EpgTimer/EpgTimer/SearchWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,15 @@ private void button_add_epgAutoAdd_Click(object sender, RoutedEventArgs e)
addItem.searchInfo = searchKey;
addItem.recSetting = recSetKey;

if (checkBox_Disable.IsChecked == true)
{
addItem.DisableSw = 1;
}
else
{
addItem.DisableSw = 0;
}

List<EpgAutoAddData> addList = new List<EpgAutoAddData>();
addList.Add(addItem);

Expand Down Expand Up @@ -353,6 +362,15 @@ private void button_chg_epgAutoAdd_Click(object sender, RoutedEventArgs e)
addItem.searchInfo = searchKey;
addItem.recSetting = recSetKey;

if (checkBox_Disable.IsChecked == true)
{
addItem.DisableSw = 1;
}
else
{
addItem.DisableSw = 0;
}

List<EpgAutoAddData> addList = new List<EpgAutoAddData>();
addList.Add(addItem);

Expand Down
9 changes: 9 additions & 0 deletions EpgTimer/EpgTimer/UserCtrlView/EpgAutoAddView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
<MenuItem Header="ジャンル" Name="JyanruKey" IsCheckable="True" Click="headerSelect_Click" />
<MenuItem Header="ネットワーク" Name="NetworkKey" IsCheckable="True" Click="headerSelect_Click" />
<MenuItem Header="サービス名" Name="ServiceKey" IsCheckable="True" Click="headerSelect_Click" />
<MenuItem Header="無効" Name="Disabled" IsCheckable="True" Click="headerSelect_Click" />
</ContextMenu>
<ContextMenu x:Key="itemMenu" x:Name="cmdMenu" >
<MenuItem Header="削除 (_D)" Click="button_del_Click" InputGestureText="Delete" />
<MenuItem Header="変更 (_C)" Click="button_change_Click" InputGestureText="Enter "/>
<MenuItem Header="有効←→無効 (_R)" Click="button_disable_reverce_Click" InputGestureText="Backspace "/>
<MenuItem Header="自動登録詳細 (_V)" Click="MenuItem_Click_AutoAddContent" />
</ContextMenu>
</UserControl.Resources>
Expand All @@ -42,6 +44,7 @@
<Setter Property="ContextMenu" Value="{DynamicResource itemMenu}" />
<Setter Property="BorderThickness" Value="5,0,0,1" />
<Setter Property="BorderBrush" Value="{Binding BorderBrush}" />
<Setter Property="Background" Value="{Binding BackColor}" />
<EventSetter Event="MouseDoubleClick" Handler="listView_key_MouseDoubleClick"/>
<EventSetter Event="PreviewMouseDown" Handler="listViewItem_PreviewMouseDown"/>
<EventSetter Event="MouseEnter" Handler="listViewItem_MouseEnter"/>
Expand Down Expand Up @@ -114,13 +117,19 @@
<GridViewColumnHeader Content="サービス名" Tag="ServiceKey" HorizontalContentAlignment="Left" ToolTip="Ctrl + クリック(マルチ・ソート)"/>
</GridViewColumn.Header>
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding Path=Disabled}">
<GridViewColumn.Header>
<GridViewColumnHeader Content="無効" Tag="Disabled" HorizontalContentAlignment="Left" ToolTip="Ctrl + クリック(マルチ・ソート)"/>
</GridViewColumn.Header>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<StackPanel Grid.Column="1" Name="stackPanel_button">
<Button Content="追加" Height="23" Name="button_add" Margin="0,10,0,10" Click="button_add_Click" Style="{StaticResource ButtonStyle1}" />
<Button Content="削除" Height="23" Name="button_del" Margin="0,10,0,10" Click="button_del_Click" Style="{StaticResource ButtonStyle1}" />
<Button Content="変更" Height="23" Name="button_change" Margin="0,10,0,10" Click="button_change_Click" Style="{StaticResource ButtonStyle1}" />
<Button Content="無効" Height="23" Name="button_disable" Margin="0,10,0,10" Style="{StaticResource ButtonStyle1}" Click="button_disable_Click" />
<!--<Button Content="↑" Height="23" Name="button_up" Margin="0,20,0,5" Click="button_up_Click" Style="{StaticResource ButtonStyle1}" />-->
<!--<Button Content="↓" Height="23" Name="button_down" Margin="0,5,0,10" Click="button_down_Click" Style="{StaticResource ButtonStyle1}" />-->
<Button Content="" Height="23" Name="button_up" Margin="0,20,0,5" Click="button_up_Click2" Style="{StaticResource ButtonStyle1}" ToolTip="Ctrl + ↑" />
Expand Down
Loading

1 comment on commit 5b7e532

@Velmy
Copy link
Owner Author

@Velmy Velmy commented on 5b7e532 Jan 8, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

補足:有効/無効でソートしたい場合は、EPGTimer/NW.exe.xml の AutoAddEpgColumn に Disabled を追加すると、有効のカラムが表示されます。
後はほかの項目と同じように、ヘッダ部分をクリックすればソートされます。
背景色は予約一覧と同じものを使っています。

Please sign in to comment.