# Basic Feeds Settings
# Copyright by Peter Maersk-Moller 2012 - All rights reserved
#verbose
require version 0.4.0

# Define allowed remote host IP addresses. If omitted then only 127.0.0.1 will be accepted.
system host allow 127.0.0.1

# Listen on port 9999 for command control connections
system control port 9999

# Set system Geometry to 1024x768
system geometry 1024 768 ARGB

# Set system frame rate to 24
system frame rate 24

# Set output control socket
system socket /tmp/mixer1

# Set feed idle time - feed 0 will always be idle. If no file is given,
# idle image will be all black.
feed idle 0 1 frames/test_1024x768
#feed idle 0 1

##################
# Input feeds
##################
# Keep size of input feeds to same size as feed 0 
# otherwise things explode.

feed add 1 Feed #1
feed geometry 1 1024 768
feed live 1
feed idle 1 100 frames/test_1024x768
feed socket 1 /tmp/feed1


######################
# Virtual feeds
#######################
# Maximized settings for any feed:
# virtual feed place rect X 20 20 1024 768 0 0 0.0 0.75 0.75 1.0

# Feed 1
# Starts maximized
# Minimized position: 800 20 
# Minimized size: 205 154
virtual feed add 1 Feed #1
virtual feed source feed 1 1
virtual feed place rect 1 20 20 1024 768 0 0 0.0 0.75 0.75 1.0

# Feed 2
# Starts minimized
# Minimized position: 800 231 
# Minimized size: 205 154
virtual feed add 2 Feed #2
virtual feed source feed 2 1
virtual feed place rect 2 800 230 1024 768 0 0 0.0 0.20 0.20 1.0

# Feed 3
# Starts minimized
# Minimized position: 800 442
# Minimized size: 205 154
virtual feed add 3 Feed #3
virtual feed source feed 3 1
virtual feed place rect 3 800 442 1024 768 0 0 0.0 0.20 0.20 1.0



command create MinimizeFeed1
	# Since everything from now on is relative,
	# we should make sure everthings is where we expect it to be
	virtual feed place rect 1 20 20 1024 768 0 0 0.0 0.75 0.75 1.0

	# The scale and coor commands are nonblocking
	virtual feed move scale 1 -0.055 -0.055 10 10
	virtual feed move coor 1 65 0 12 0

	# Allow Maximizing
	command restart MaximizeFeed1
command end

command create MaximizeFeed1
	# Since everything from now on is relative,
	# we should make sure everthings is where we expect it to be
	virtual feed place rect 1 800 20 1024 768 0 0 0.0 0.20 0.20 1.0

	# The scale and coor commands are nonblocking
	virtual feed move scale 1 0.055 0.055 10 10
	virtual feed move coor 1 -65 0 12 0
	
	# Allow Minimizing
	command restart MinimizeFeed1
command end

command create MinimizeFeed2
	# Since everything from now on is relative,
	# we should make sure everthings is where we expect it to be
	virtual feed place rect 2 20 20 1024 768 0 0 0.0 0.75 0.75 1.0

	# The scale and coor commands are nonblocking
	virtual feed move scale 2 -0.055 -0.055 10 10
	virtual feed move coor 2 65 21 12 10

	# Allow Maximizing
	command restart MaximizeFeed2
command end

command create MaximizeFeed2
	# Since everything from now on is relative,
	# we should make sure everthings is where we expect it to be
	virtual feed place rect 2 800 230 1024 768 0 0 0.0 0.20 0.20 1.0

	# The scale and coor commands are nonblocking
	virtual feed move scale 2 0.055 0.055 10 10
	virtual feed move coor 2 -65 -21 12 10
	
	# Allow Minimizing
	command restart MinimizeFeed2
command end

command create MinimizeFeed3
	# Since everything from now on is relative,
	# we should make sure everthings is where we expect it to be
	virtual feed place rect 3 20 20 1024 768 0 0 0.0 0.75 0.75 1.0

	# The scale and coor commands are nonblocking
	virtual feed move scale 3 -0.055 -0.055 10 10
	virtual feed move coor 3 65 35 12 12

	# Allow Maximizing
	command restart MaximizeFeed3
command end

command create MaximizeFeed3
	# Since everything from now on is relative,
	# we should make sure everthings is where we expect it to be
	virtual feed place rect 3 800 442 1024 768 0 0 0.0 0.20 0.20 1.0

	# The scale and coor commands are nonblocking
	virtual feed move scale 3 0.055 0.055 10 10
	virtual feed move coor 3 -65 -35 12 12
	
	# Allow Minimizing
	command restart MinimizeFeed3
command end

command create Swap12
	MinimizeFeed1
	MaximizeFeed2
	command restart Swap21
	command restart Swap23
command end

command create Swap13
	MinimizeFeed1
	MaximizeFeed3
	command restart Swap31
	command restart Swap32
command end

command create Swap21
	MinimizeFeed2
	MaximizeFeed1
	command restart Swap12
	command restart Swap13
command end

command create Swap23
	MinimizeFeed2
	MaximizeFeed3
	command restart Swap31
	command restart Swap32
command end

command create Swap31
	MinimizeFeed3
	MaximizeFeed1
	command restart Swap12
	command restart Swap13
command end


command create Swap32
	MinimizeFeed3
	MaximizeFeed2
	command restart Swap21
	command restart Swap23
command end

stack  0

# Load the background
image load 0 images/background.png
image place 0 0 0 0

# Load the logo
image load 1 images/logo.png
image place 1 1 24 24


command create Show
  overlay image 0

  overlay virtual feed 1..3

  overlay image 1
  #overlay text all
  loop
command end

overlay finish Show


#montor on