Skip to content

Commit

Permalink
Merge pull request #85 from hcmlab/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tobiasbaur authored Nov 29, 2016
2 parents 18870be + d298567 commit 1f5085c
Show file tree
Hide file tree
Showing 12 changed files with 288 additions and 199 deletions.
2 changes: 1 addition & 1 deletion app/Window1.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:view="clr-namespace:ssi;assembly=ssiview"
xmlns:local="clr-namespace:ssi"
Title="(NOn)Verbal Annotator | v0.9.9.2.5 | HCM-Lab, Augsburg University | http://openssi.net" WindowState="Maximized" Height="Auto" Width="Auto" AllowDrop="True" AllowsTransparency="False" Icon="ui.ico">
Title="(NOn)Verbal Annotator | v0.9.9.2.6 | HCM-Lab, Augsburg University | http://openssi.net" WindowState="Maximized" Height="Auto" Width="Auto" AllowDrop="True" AllowsTransparency="False" Icon="ui.ico">

<Grid>

Expand Down
2 changes: 1 addition & 1 deletion app_metro/Window1.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:view="clr-namespace:ssi;assembly=ssiview"
xmlns:local="clr-namespace:ssi"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Title="(NOn)Verbal Annotator | v0.9.9.2.5| HCM-Lab, Augsburg University | http://openssi.net" WindowState="Maximized" Height="Auto" Width="Auto" AllowDrop="True" AllowsTransparency="False" Icon="ui.ico">
Title="(NOn)Verbal Annotator | v0.9.9.2.6| HCM-Lab, Augsburg University | http://openssi.net" WindowState="Maximized" Height="Auto" Width="Auto" AllowDrop="True" AllowsTransparency="False" Icon="ui.ico">

<Grid>

Expand Down
Binary file modified bin/nova.exe
Binary file not shown.
Binary file modified bin/nova_metro.exe
Binary file not shown.
47 changes: 31 additions & 16 deletions dll/AnnoTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -738,9 +738,6 @@ protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
_PreviouWidth = selected_segment.Width;
_PreviouHeight = selected_segment.Height;
_PreviouMargin = new Point(((FrameworkElement)selected_segment).Margin.Left, ((FrameworkElement)selected_segment).Margin.Top);

//ChangeRepresentationObject ChangeRepresentationObjectOfResize = UnDoObject.MakeChangeRepresentationObjectForResize(_PreviouMargin, _PreviouWidth, _PreviouHeight, (FrameworkElement)selected_segment, selected_segment.is_resizeable_right, selected_segment.is_resizeable_left, selected_segment.is_moveable);
//UnDoObject.InsertObjectforUndoRedo(ChangeRepresentationObjectOfResize);
}
}

Expand Down Expand Up @@ -894,6 +891,16 @@ public void mouseMove(MouseEventArgs e)
if (selected_segment.is_resizeable_right)
{
double delta = point.X - selected_segment.ActualWidth;

if (isMouseAlreadydown == false)
{
// Console.WriteLine("ResizeRight");
//TODO: Logic for Redo
isMouseAlreadydown = true;

}


if (segmentwidth >= Properties.Settings.Default.DefaultMinSegmentSize)
{
if (point.X > ViewHandler.Time.PixelFromTime(ViewHandler.Time.SelectionStop)) delta = ViewHandler.Time.PixelFromTime(ViewHandler.Time.SelectionStop) - selected_segment.ActualWidth;
Expand All @@ -913,6 +920,17 @@ public void mouseMove(MouseEventArgs e)
// resize segment left
else if (selected_segment.is_resizeable_left)
{

if (isMouseAlreadydown == false)
{
//TODO: Logic for Redo
// Console.WriteLine("ResizeLeft");

isMouseAlreadydown = true;

}


double delta = point.X;
if (selected_segment.Item.Duration - segmentwidth >= Properties.Settings.Default.DefaultMinSegmentSize)
{
Expand All @@ -935,18 +953,17 @@ public void mouseMove(MouseEventArgs e)
double delta = point.X - selected_segment.ActualWidth / 2;
if (pos + delta >= 0 && pos + selected_segment.ActualWidth + delta <= this.Width)
{
//if (isMouseAlreadydown == false)
//{

// _PreviouWidth = selected_segment.Width;
// _PreviouHeight = selected_segment.Height;
// _PreviouMargin = new Point(selected_segment.Margin.Left, (selected_segment).Margin.Top);
if (isMouseAlreadydown == false)
{
// Console.WriteLine("Move");
//TODO: Logic for Redo
// _PreviouMargin = new Point(Canvas.GetLeft(selected_segment),0);

// ChangeRepresentationObject ChangeRepresentationObjectOfMove = UnDoObject.MakeChangeRepresentationObjectForMove(_PreviouMargin, (FrameworkElement)selected_segment);
// UnDoObject.InsertObjectforUndoRedo(ChangeRepresentationObjectOfMove);
// isMouseAlreadydown = true;
// ChangeRepresentationObject ChangeRepresentationObjectOfMove = UnDoObject.MakeChangeRepresentationObjectForMove(_PreviouMargin, (FrameworkElement)selected_segment, selected_segment.Width, selected_segment.Item.Duration);
//UnDoObject.InsertObjectforUndoRedo(ChangeRepresentationObjectOfMove);
isMouseAlreadydown = true;

//}
}
selected_segment.move(delta);
SelectSegment(selected_segment);
this.select(true);
Expand All @@ -956,9 +973,7 @@ public void mouseMove(MouseEventArgs e)
}
else
{


isMouseAlreadydown = false;
isMouseAlreadydown = false;

// check if use can resize/move
selected_segment.checkResizeable(point);
Expand Down
4 changes: 3 additions & 1 deletion dll/Database/DatabaseAdminWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ public void AddMediatoDatabase(string connection, string db, string session, str

if (connection == "sftp") url = "sftp://" + ip + folder + "/" + filename;
if (connection == "ftp") url = "ftp://" + ip + folder + "/" + filename;
if (connection == "http") url = filenames[i];

if (connection == "http" && auth == false) url = filenames[i];
else if (connection == "http" && auth == true) url = ip;

BsonDocument b = new BsonDocument
{
Expand Down
2 changes: 1 addition & 1 deletion dll/Database/DatabaseHandlerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private void GetMedia()
foreach (DatabaseMediaInfo c in ci)
{
files.Add(c);
if (!c.filepath.Contains(".stream~") && !c.filepath.Contains(".stream%7E"))
if (!c.filename.Contains(".stream~") && !c.filename.Contains(".stream%7E"))
{
MediaResultBox.Items.Add(c.filename);
}
Expand Down
12 changes: 11 additions & 1 deletion dll/Database/DatabaseMediaWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,24 @@ public DatabaseMediaWindow()

private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (Connectiontype.SelectedIndex == 2)
if (Connectiontype.SelectedIndex == 2 && requiresAuth.IsChecked == false)
{
ServerLabel.Visibility = Visibility.Collapsed;
ServerTextfield.Visibility = Visibility.Collapsed;
FolderLabel.Visibility = Visibility.Collapsed;
FolderTextfield.Visibility = Visibility.Collapsed;
InputDescription.Content = "URLs, seperated by lines";
}

else if (Connectiontype.SelectedIndex == 2 && requiresAuth.IsChecked == true)
{
ServerLabel.Visibility = Visibility.Visible;
ServerTextfield.Visibility = Visibility.Visible;
FolderLabel.Visibility = Visibility.Collapsed;
FolderTextfield.Visibility = Visibility.Collapsed;
InputDescription.Content = "URLs, seperated by lines";
}

else if (Connectiontype.SelectedIndex == 0 || Connectiontype.SelectedIndex == 1)
{
ServerLabel.Visibility = Visibility.Visible;
Expand Down
2 changes: 1 addition & 1 deletion dll/Signal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ public static Signal LoadStreamFile(string filepath)
}
catch (Exception e)
{
ViewTools.ShowErrorMessage(e.ToString());
ViewTools.ShowErrorMessage(filepath + ": " + e.ToString());
return null;
}

Expand Down
60 changes: 42 additions & 18 deletions dll/UndoRedo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ public void Undo(int level)
// this.RedoPushInUnDoForMove(previousMarginOfSelectedObject, Undostruct.UiElement);

//}

else if (Undostruct.Action == ActionType.Move)
{

Point previousMarginOfSelectedObject = new Point((Canvas.GetLeft((FrameworkElement)Undostruct.UiElement)), 0);
Canvas.SetLeft(Undostruct.UiElement,Undostruct.Margin.X);
Undostruct.UiElement.Width = Undostruct.Width;


// ((AnnoTrackSegment)Undostruct.UiElement).Item.Duration = Undostruct.Duration;
this.RedoPushInUnDoForMove(previousMarginOfSelectedObject, Undostruct.UiElement, Undostruct.Width, Undostruct.Duration);
}
}

if (EnableDisableUndoRedoFeature != null)
Expand Down Expand Up @@ -134,13 +146,28 @@ public void Redo(int level)
// Undostruct.UiElement.Width = Undostruct.Width;

//}
//else if (Undostruct.Action == ActionType.Move)
//{
// Point previousMarginOfSelectedObject = new Point(((FrameworkElement)Undostruct.UiElement).Margin.Left, ((FrameworkElement)Undostruct.UiElement).Margin.Top);
// ChangeRepresentationObject ChangeRepresentationObjectForMove = this.MakeChangeRepresentationObjectForMove(previousMarginOfSelectedObject, Undostruct.UiElement);
// _UndoActionsCollection.Push(ChangeRepresentationObjectForMove);
// Undostruct.UiElement.Margin = new Thickness(Undostruct.Margin.X, Undostruct.Margin.Y, 0, 0);
//}
else if (Undostruct.Action == ActionType.Move)
{

Point previousMarginOfSelectedObject = new Point((Canvas.GetLeft((FrameworkElement)Undostruct.UiElement)), 0);



Canvas.SetLeft(Undostruct.UiElement, Undostruct.Margin.X);
Undostruct.UiElement.Width = Undostruct.Width;
// ((AnnoTrackSegment)Undostruct.UiElement).Item.Duration = Undostruct.Duration;


AnnoListItem ali = ((AnnoTrackSegment)Undostruct.UiElement).Item;
((AnnoTrack)Container).deleteSegment((AnnoTrackSegment)Undostruct.UiElement);
((AnnoTrack)Container).AnnoList.AddSorted(ali);
AnnoTrackSegment at = ((AnnoTrack)Container).addSegment(ali);



ChangeRepresentationObject ChangeRepresentationObjectForMove = this.MakeChangeRepresentationObjectForMove(previousMarginOfSelectedObject, Undostruct.UiElement, Undostruct.Width, Undostruct.Duration);
_UndoActionsCollection.Push(ChangeRepresentationObjectForMove);
}
}
if (EnableDisableUndoRedoFeature != null)
{
Expand Down Expand Up @@ -178,13 +205,13 @@ public ChangeRepresentationObject MakeChangeRepresentationObjectForDelete(Framew
return dataobject;
}

public ChangeRepresentationObject MakeChangeRepresentationObjectForMove(Point margin, FrameworkElement UIelement)
public ChangeRepresentationObject MakeChangeRepresentationObjectForMove(Point margin, FrameworkElement UIelement, double Width, double duration)
{
ChangeRepresentationObject MoveStruct = new ChangeRepresentationObject();
MoveStruct.Action = ActionType.Move;
MoveStruct.Margin = margin;
MoveStruct.height = 0;
MoveStruct.Width = 0;
MoveStruct.Width = Width;
MoveStruct.Duration = duration;
MoveStruct.UiElement = UIelement;
return MoveStruct;
}
Expand All @@ -194,7 +221,6 @@ public ChangeRepresentationObject MakeChangeRepresentationObjectForResize(Point
ChangeRepresentationObject ResizeStruct = new ChangeRepresentationObject();
ResizeStruct.Action = ActionType.Resize;
ResizeStruct.Margin = margin;
ResizeStruct.height = height;
ResizeStruct.Width = width;
ResizeStruct.isresizeright = isresizeright;
ResizeStruct.isresizeleft = isresizeleft;
Expand Down Expand Up @@ -229,23 +255,21 @@ public void RedoPushInUnDoForDelete(FrameworkElement ApbOrDevice)
_RedoActionsCollection.Push(dataobject);
}

public void RedoPushInUnDoForMove(Point margin, FrameworkElement UIelement)
public void RedoPushInUnDoForMove(Point margin, FrameworkElement UIelement, double Width, double Duration)
{
ChangeRepresentationObject MoveStruct = new ChangeRepresentationObject();
MoveStruct.Action = ActionType.Move;
MoveStruct.Margin = margin;
MoveStruct.height = 0;
MoveStruct.Width = 0;
MoveStruct.Width = Width;
MoveStruct.UiElement = UIelement;
_RedoActionsCollection.Push(MoveStruct);
}

public void RedoPushInUnDoForResize(Point margin, double width, double height, FrameworkElement UIelement)
public void RedoPushInUnDoForResize(Point margin, double width, double height, FrameworkElement UIelement, double Width)
{
ChangeRepresentationObject ResizeStruct = new ChangeRepresentationObject();
ResizeStruct.Margin = margin;
ResizeStruct.height = height;
ResizeStruct.Width = width;
ResizeStruct.Width = Width;
ResizeStruct.UiElement = UIelement;
ResizeStruct.Action = ActionType.Resize;
_RedoActionsCollection.Push(ResizeStruct);
Expand Down Expand Up @@ -302,7 +326,7 @@ public class ChangeRepresentationObject
public bool ismoved;
public Point Margin;
public double Width;
public double height;
public double Duration;
public FrameworkElement UiElement;
}

Expand Down
4 changes: 2 additions & 2 deletions dll/ViewControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@
<ColumnDefinition Width="177*" />
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Name="tb" Text="Loading Data..." HorizontalAlignment="Center" Foreground="White" FontSize="30" Grid.ColumnSpan="2" />
<Button Name="cancel" Visibility="Collapsed" VerticalAlignment="Bottom" Background="Transparent" Content="Cancel" HorizontalAlignment="Center" Foreground="White" FontSize="30" Grid.ColumnSpan="2" />
<TextBlock Name="ShadowBoxText" Text="Loading Data..." HorizontalAlignment="Center" Foreground="White" FontSize="30" Grid.ColumnSpan="2" />
<Button Name="ShadowBoxCancel" Visibility="Collapsed" VerticalAlignment="Bottom" Background="Transparent" Content="Cancel" HorizontalAlignment="Center" Foreground="White" FontSize="30" Grid.ColumnSpan="2" />
</StackPanel>

</Grid>
Expand Down
Loading

0 comments on commit 1f5085c

Please sign in to comment.