Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Data\reserve.cs
- 連続した録画を空きがあれば別チューナーで予約する
- 156行目を変更
- name not in (select tuner from reserve where {1} <= end and {2} >= start and status & {3})
- Streaming\Encoder.cs
- パイプライターとパイプリーダーを定義 //字幕用
- 13-14行目の間に追加
- BinaryReader reader;
- BinaryWriter pwriter;
- BinaryReader preader;
- BinaryWriter writer;
- tsreadexを起動 //字幕用
- 21行目var p = new Process();の上に追加
- var p1 = new Process();
- p1.StartInfo.FileName = "cmd.exe";
- p1.StartInfo.Arguments = "/c tsreadex -x 18/38/39 -n -1 -a 13 -b 5 -c 1 -u 1 -d 13 -";
- p1.StartInfo.UseShellExecute = false;
- p1.StartInfo.CreateNoWindow = window;
- p1.StartInfo.RedirectStandardInput = true;
- p1.StartInfo.RedirectStandardOutput = true;
- p1.Start();
- var pをp2にリネーム //わかりやすさのためなので全部pのままでも可、字幕用
- 21-31行目を変更
- var p2 = new Process();
- p2.StartInfo.WorkingDirectory = workDir;
- p2.StartInfo.FileName = encoder;
- p2.StartInfo.Arguments = option;
- p2.StartInfo.UseShellExecute = false;
- p2.StartInfo.CreateNoWindow = window;
- p2.StartInfo.RedirectStandardInput = true;
- p2.StartInfo.RedirectStandardOutput = true;
- p2.Start();
- process = p2;
- パイプライターとパイプリーダーを宣言して標準入出力を設定 //エンコーダの前にtsreadexを通す、字幕用
- 33-34行目の間に追加、33-34行目を変更
- reader = new BinaryReader(p2.StandardOutput.BaseStream);
- pwriter = new BinaryWriter(p2.StandardInput.BaseStream);
- preader = new BinaryReader(p1.StandardOutput.BaseStream);
- writer = new BinaryWriter(p1.StandardInput.BaseStream);
- Interlocked.Increment(ref ready);
- tsreadexからエンコーダへデータを送信 //字幕用
- 37行目「//エンコーダの変換が止まってないか監視するスレッド」の上に追加
- Task.Factory.StartNew(() =>
- {
- try
- {
- var buf = new byte[188 * 1024];
- while (true)
- {
- var count = preader.Read(buf, 0, buf.Length);
- if (count > 0)
- pwriter.Write(buf, 0, count);
- else
- break;
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine("ライブ→エンコーダでエラーが発生... " + ex.Message);
- }
- if (pwriter != null) pwriter.Close();
- pwriter = null;
- }, TaskCreationOptions.AttachedToParent);
- パイプライターとパイプリーダーを終了させる //字幕用
- 104-105行目の間に追加
- if (reader != null) reader.Close();
- if (pwriter != null) pwriter.Close();
- if (preader != null) preader.Close();
- if (writer != null) writer.Close();
- Streaming\VideoStreamReader.cs
- ライブ視聴開始時にスリープを抑止 //BonDriverProxyExを利用なら不要
- 43行目Interlocked.Increment(ref ready);の下に追加
- SleepState.Stop(true);
- ライブ視聴終了時にスリープ抑止を解除 //BonDriverProxyExを利用なら不要
- 75行目Interlocked.Decrement(ref ready);の上に追加
- SleepState.Stop(false);
- サブフォルダのTSファイルも再生可能にする
- 106行目を変更
- var path = Directory.GetFiles(AppDefine.Main.Data["record.folder"], rec.File, SearchOption.AllDirectories)[0];
- 録画視聴開始時にスリープを抑止
- 123行目Interlocked.Increment(ref ready);の下に追加
- SleepState.Stop(true);
- 録画視聴終了時にスリープ抑止を解除
- 133行目Interlocked.Decrement(ref ready);の上に追加
- SleepState.Stop(false);
- Web\WebApi.cs
- サブフォルダのTSファイルも削除可能にする //あえて変更しなければサブフォルダのTSファイルは削除できないままなのでフォルダで整理したものを削除したくない場合は変えないほうがいい
- 325行目を変更
- var file = Directory.GetFiles(AppDefine.Main.Data["record.folder"], record.File, SearchOption.AllDirectories)[0];
- サブフォルダのTSファイルもファイルチェック可能にする
- 336行目を変更
- var files = Directory.GetFiles(recFolder, "*.ts", SearchOption.AllDirectories);
- サブフォルダのTSファイルも登録する
- 404行目を変更
- var files = Directory.GetFiles(AppDefine.Main.Data["record.folder"], "*.ts", SearchOption.AllDirectories);
- EpgUpdater.cs
- 番組表更新開始時にスリープを抑止しない //BonDriverProxyExを利用の場合
- 45行目を削除
- SleepState.Stop(true);
- 番組表更新終了時にスリープ抑止を解除しない //BonDriverProxyExを利用の場合
- SleepState.Stop(false);
- Recorder.cs
- GetNextReserveTime()関数を削除 //終了マージンをマイナスにしたい場合
- 43-50行目を削除
- 「//次の予約の時間を取得」からpublic void Start()の上まで
- 連続した録画があっても終了マージンを変更しない //終了マージンをマイナスにしたい場合
- 70-72行目を削除
- 「//次の予約と現在の予約の間がマージン以上空いていたらマージンを0にする」からif (reserve.EndTime - margin < DateTime.Now)の上まで
- 録画開始時にスリープを抑止しない //BonDriverProxyExを利用の場合
- 221行目を削除
- SleepState.Stop(true);
- 録画終了時にスリープ抑止を解除しない //BonDriverProxyExを利用の場合
- 306行目を削除
- SleepState.Stop(false);
- Tvmaid.csproj
- DynamicJsonを相対パスで参照する
- 64行目を変更
- <HintPath>..\lib\
- System.Data.SQLiteを相対パスで参照する
- 71行目を変更
- <HintPath>..\lib\
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement