Skip to content

Commit

Permalink
ブランチ Topic # 0004 をマージ
Browse files Browse the repository at this point in the history
  • Loading branch information
takahiro-itou committed Sep 18, 2024
2 parents 736a459 + 2819e5a commit fb9049b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
27 changes: 17 additions & 10 deletions AsfEditor/EditTimeForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -92,31 +92,24 @@ Public Function initializeVideo() As Boolean
''--------------------------------------------------------------------
'' ビデオを初期化する
''--------------------------------------------------------------------
Dim fileName As String
Dim msFirstPos As Long

With m_currentInfo
fileName = .sFileName
txtStartTime.Text = .sStartTime
txtEndTime.Text = .sEndTime
msFirstPos = getMiliSeconds(.sStartTime)
End With

If m_workVideo Is Nothing
m_workVideo = New MciWrapper("", 1)
End If

With m_workVideo
.setFileName(fileName)
.openAsfFile(picVideo)
.bindToPictureBox(picVideo)

m_msVideoLength = .getVideoLength()
m_sLengthText = getTimeTextFromMiliSeconds(m_msVideoLength)

setPositionMiliSeconds(msFirstPos, True)
End With

initializeVideo = True
Return True

End Function

Expand All @@ -125,9 +118,23 @@ Public Function setTargetInfo(ByVal targetInfo As InputInfo) As Boolean
''--------------------------------------------------------------------
'' 設定内容を読み書きするインスタンスを指定する
''--------------------------------------------------------------------
Dim fileName As String

m_currentInfo = targetInfo
setTargetInfo = True
With targetInfo
fileName = .sFileName
End With

If m_workVideo Is Nothing
m_workVideo = New MciWrapper("", 1)
End If

With m_workVideo
.setFileName(fileName)
.openAsfFile(picVideo)
End With

Return True

End Function

Expand Down
20 changes: 10 additions & 10 deletions AsfEditor/MainView.resx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
<value>32, 20</value>
</data>
<data name="btnOutput.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
<value>2</value>
</data>
<data name="btnOutput.Text" xml:space="preserve">
<value>...</value>
Expand All @@ -244,7 +244,7 @@
<value>System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnPerform.ZOrder" xml:space="preserve">
<value>0</value>
<value>6</value>
</data>
<data name="btnPerform.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Right</value>
Expand All @@ -259,7 +259,7 @@
<value>96, 32</value>
</data>
<data name="btnPerform.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
<value>6</value>
</data>
<data name="btnPerform.Text" xml:space="preserve">
<value>&amp;Perform</value>
Expand Down Expand Up @@ -337,7 +337,7 @@
<value>System.Windows.Forms.Button, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnWorkDir.ZOrder" xml:space="preserve">
<value>1</value>
<value>5</value>
</data>
<data name="btnWorkDir.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
Expand Down Expand Up @@ -552,7 +552,7 @@
<value>System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblOutFile.ZOrder" xml:space="preserve">
<value>6</value>
<value>0</value>
</data>
<data name="lblOutFile.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 24</value>
Expand Down Expand Up @@ -580,7 +580,7 @@
<value>System.Windows.Forms.Label, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblWorkDir.ZOrder" xml:space="preserve">
<value>4</value>
<value>3</value>
</data>
<data name="lblWorkDir.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
Expand All @@ -592,7 +592,7 @@
<value>96, 19</value>
</data>
<data name="lblWorkDir.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
<value>3</value>
</data>
<data name="lblWorkDir.Text" xml:space="preserve">
<value>Work Dir :</value>
Expand Down Expand Up @@ -799,7 +799,7 @@
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtOutFile.ZOrder" xml:space="preserve">
<value>5</value>
<value>1</value>
</data>
<data name="txtOutFile.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
Expand All @@ -824,7 +824,7 @@
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtWorkDir.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="txtWorkDir.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
Expand All @@ -836,7 +836,7 @@
<value>552, 19</value>
</data>
<data name="txtWorkDir.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
<value>4</value>
</data>

</root>
21 changes: 9 additions & 12 deletions AsfEditor/MciWrapper.vb
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ Dim result As Integer

If m_aliasName = "" Then
' インスタンスが未初期化
openAsfFile = OpenErrorCode.NOT_INITIALIZED
Exit Function
Return OpenErrorCode.NOT_INITIALIZED
End If

' ファイルを開く
Expand All @@ -224,19 +223,18 @@ Dim result As Integer

result = sendMciCommand(mciCmd)
If result <> 0 Then
openAsfFile = OpenErrorCode.FILE_NOT_FOUND
Exit Function
Return OpenErrorCode.FILE_NOT_FOUND
End If

' 時間の単位をミリ秒に設定する
mciCmd = String.Format( "set {0} time format milliseconds", m_aliasName)
result = sendMciCommand(mciCmd)
If result <> 0 Then
openAsfFile = OpenErrorCode.FAILURE
Exit Function
Return OpenErrorCode.FAILURE
End If

openAsfFile = OpenErrorCode.SUCCESS
Return OpenErrorCode.SUCCESS

End Function


Expand All @@ -249,16 +247,15 @@ Dim result As OpenErrorCode

result = openAsfFile()
If (result <> OpenErrorCode.SUCCESS) Then
openAsfFile = result
Exit Function
Return result
End If

If bindToPictureBox(targetWindow) = False Then
openAsfFile = OpenErrorCode.FAILURE
Exit Function
Return OpenErrorCode.FAILURE
End If

openAsfFile = True
Return OpenErrorCode.SUCCESS

End Function


Expand Down

0 comments on commit fb9049b

Please sign in to comment.