redbutton-devel Mailing List for RedButton MHEG Engine (Page 17)
Brought to you by:
skilvington
You can subscribe to this list here.
| 2006 |
Jan
(1) |
Feb
(4) |
Mar
(27) |
Apr
(6) |
May
(46) |
Jun
(45) |
Jul
(7) |
Aug
(4) |
Sep
(7) |
Oct
(5) |
Nov
(10) |
Dec
(11) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(49) |
Feb
(29) |
Mar
(35) |
Apr
(43) |
May
(23) |
Jun
(4) |
Jul
(1) |
Aug
(58) |
Sep
(66) |
Oct
(27) |
Nov
(15) |
Dec
(1) |
| 2008 |
Jan
(11) |
Feb
|
Mar
(8) |
Apr
|
May
|
Jun
(30) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(3) |
Dec
(6) |
| 2009 |
Jan
(6) |
Feb
(1) |
Mar
(2) |
Apr
(5) |
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(6) |
| 2010 |
Jan
(6) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(4) |
Oct
|
Nov
(11) |
Dec
(4) |
| 2011 |
Jan
|
Feb
(11) |
Mar
(8) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
(2) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ski...@us...> - 2007-03-28 14:58:35
|
Revision: 263
http://svn.sourceforge.net/redbutton/?rev=263&view=rev
Author: skilvington
Date: 2007-03-28 07:58:34 -0700 (Wed, 28 Mar 2007)
Log Message:
-----------
VideoClass has no OriginalPaletteRef attribute
Modified Paths:
--------------
redbutton-browser/trunk/ElementaryAction.c
redbutton-browser/trunk/VideoClass.c
redbutton-browser/trunk/VideoClass.h
Modified: redbutton-browser/trunk/ElementaryAction.c
===================================================================
--- redbutton-browser/trunk/ElementaryAction.c 2007-03-28 14:30:28 UTC (rev 262)
+++ redbutton-browser/trunk/ElementaryAction.c 2007-03-28 14:58:34 UTC (rev 263)
@@ -1367,8 +1367,6 @@
SliderClass_SetPaletteRef((SliderClass *) obj, &e->u.set_palette_ref, caller_gid);
else if(obj->inst.rtti == RTTI_TextClass)
TextClass_SetPaletteRef((TextClass *) obj, &e->u.set_palette_ref, caller_gid);
- else if(obj->inst.rtti == RTTI_VideoClass)
- VideoClass_SetPaletteRef((VideoClass *) obj, &e->u.set_palette_ref, caller_gid);
else
error("SetPaletteRef: unexpected target: %s", ExternalReference_name(&obj->inst.ref));
}
Modified: redbutton-browser/trunk/VideoClass.c
===================================================================
--- redbutton-browser/trunk/VideoClass.c 2007-03-28 14:30:28 UTC (rev 262)
+++ redbutton-browser/trunk/VideoClass.c 2007-03-28 14:58:34 UTC (rev 263)
@@ -352,16 +352,6 @@
}
void
-VideoClass_SetPaletteRef(VideoClass *t, SetPaletteRef *params, OctetString *caller_gid)
-{
- verbose("VideoClass: %s; SetPaletteRef", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: VideoClass_SetPaletteRef not yet implemented\n");
- return;
-}
-
-void
VideoClass_SetVideoDecodeOffset(VideoClass *t, SetVideoDecodeOffset *params, OctetString *caller_gid)
{
verbose("VideoClass: %s; SetVideoDecodeOffset", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/VideoClass.h
===================================================================
--- redbutton-browser/trunk/VideoClass.h 2007-03-28 14:30:28 UTC (rev 262)
+++ redbutton-browser/trunk/VideoClass.h 2007-03-28 14:58:34 UTC (rev 263)
@@ -20,7 +20,6 @@
void VideoClass_SendToBack(VideoClass *);
void VideoClass_PutBefore(VideoClass *, PutBefore *, OctetString *);
void VideoClass_PutBehind(VideoClass *, PutBehind *, OctetString *);
-void VideoClass_SetPaletteRef(VideoClass *, SetPaletteRef *, OctetString *);
void VideoClass_SetVideoDecodeOffset(VideoClass *, SetVideoDecodeOffset *, OctetString *);
void VideoClass_GetVideoDecodeOffset(VideoClass *, GetVideoDecodeOffset *, OctetString *);
void VideoClass_ScaleVideo(VideoClass *, ScaleVideo *, OctetString *);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-28 14:30:31
|
Revision: 262
http://svn.sourceforge.net/redbutton/?rev=262&view=rev
Author: skilvington
Date: 2007-03-28 07:30:28 -0700 (Wed, 28 Mar 2007)
Log Message:
-----------
the remaining objects with no ContentHook
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
redbutton-browser/trunk/DynamicLineArtClass.h
redbutton-browser/trunk/ElementaryAction.c
redbutton-browser/trunk/ListGroupClass.c
redbutton-browser/trunk/ListGroupClass.h
redbutton-browser/trunk/RectangleClass.c
redbutton-browser/trunk/RectangleClass.h
redbutton-browser/trunk/SliderClass.c
redbutton-browser/trunk/SliderClass.h
redbutton-browser/trunk/TokenGroupClass.c
redbutton-browser/trunk/TokenGroupClass.h
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-28 14:30:28 UTC (rev 262)
@@ -112,16 +112,6 @@
}
void
-DynamicLineArtClass_SetData(DynamicLineArtClass *t, SetData *set, OctetString *caller_gid)
-{
- verbose("DynamicLineArtClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: DynamicLineArtClass_SetData not yet implemented\n");
- return;
-}
-
-void
DynamicLineArtClass_Clone(DynamicLineArtClass *t, Clone *params, OctetString *caller_gid)
{
verbose("DynamicLineArtClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/DynamicLineArtClass.h
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.h 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/DynamicLineArtClass.h 2007-03-28 14:30:28 UTC (rev 262)
@@ -12,7 +12,6 @@
void DynamicLineArtClass_Deactivation(DynamicLineArtClass *);
void DynamicLineArtClass_Destruction(DynamicLineArtClass *);
-void DynamicLineArtClass_SetData(DynamicLineArtClass *, SetData *, OctetString *);
void DynamicLineArtClass_Clone(DynamicLineArtClass *, Clone *, OctetString *);
void DynamicLineArtClass_SetPosition(DynamicLineArtClass *, SetPosition *, OctetString *);
void DynamicLineArtClass_GetPosition(DynamicLineArtClass *, GetPosition *, OctetString *);
Modified: redbutton-browser/trunk/ElementaryAction.c
===================================================================
--- redbutton-browser/trunk/ElementaryAction.c 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/ElementaryAction.c 2007-03-28 14:30:28 UTC (rev 262)
@@ -1185,22 +1185,12 @@
{
if(obj->inst.rtti == RTTI_BitmapClass)
BitmapClass_SetData((BitmapClass *) obj, &e->u.set_data, caller_gid);
- else if(obj->inst.rtti == RTTI_DynamicLineArtClass)
- DynamicLineArtClass_SetData((DynamicLineArtClass *) obj, &e->u.set_data, caller_gid);
- else if(obj->inst.rtti == RTTI_RectangleClass)
- RectangleClass_SetData((RectangleClass *) obj, &e->u.set_data, caller_gid);
else if(obj->inst.rtti == RTTI_TextClass)
TextClass_SetData((TextClass *) obj, &e->u.set_data, caller_gid);
else if(obj->inst.rtti == RTTI_EntryFieldClass)
EntryFieldClass_SetData((EntryFieldClass *) obj, &e->u.set_data, caller_gid);
else if(obj->inst.rtti == RTTI_HyperTextClass)
HyperTextClass_SetData((HyperTextClass *) obj, &e->u.set_data, caller_gid);
- else if(obj->inst.rtti == RTTI_SliderClass)
- SliderClass_SetData((SliderClass *) obj, &e->u.set_data, caller_gid);
- else if(obj->inst.rtti == RTTI_TokenGroupClass)
- TokenGroupClass_SetData((TokenGroupClass *) obj, &e->u.set_data, caller_gid);
- else if(obj->inst.rtti == RTTI_ListGroupClass)
- ListGroupClass_SetData((ListGroupClass *) obj, &e->u.set_data, caller_gid);
else if(obj->inst.rtti == RTTI_StreamClass)
StreamClass_SetData((StreamClass *) obj, &e->u.set_data, caller_gid);
else
Modified: redbutton-browser/trunk/ListGroupClass.c
===================================================================
--- redbutton-browser/trunk/ListGroupClass.c 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/ListGroupClass.c 2007-03-28 14:30:28 UTC (rev 262)
@@ -86,16 +86,6 @@
}
void
-ListGroupClass_SetData(ListGroupClass *t, SetData *set, OctetString *caller_gid)
-{
- verbose("ListGroupClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: ListGroupClass_SetData not yet implemented\n");
- return;
-}
-
-void
ListGroupClass_Clone(ListGroupClass *t, Clone *params, OctetString *caller_gid)
{
verbose("ListGroupClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/ListGroupClass.h
===================================================================
--- redbutton-browser/trunk/ListGroupClass.h 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/ListGroupClass.h 2007-03-28 14:30:28 UTC (rev 262)
@@ -12,7 +12,6 @@
void ListGroupClass_Deactivation(ListGroupClass *);
void ListGroupClass_Destruction(ListGroupClass *);
-void ListGroupClass_SetData(ListGroupClass *, SetData *, OctetString *);
void ListGroupClass_Clone(ListGroupClass *, Clone *, OctetString *);
void ListGroupClass_Move(ListGroupClass *, Move *, OctetString *);
void ListGroupClass_MoveTo(ListGroupClass *, MoveTo *, OctetString *);
Modified: redbutton-browser/trunk/RectangleClass.c
===================================================================
--- redbutton-browser/trunk/RectangleClass.c 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/RectangleClass.c 2007-03-28 14:30:28 UTC (rev 262)
@@ -102,16 +102,6 @@
}
void
-RectangleClass_SetData(RectangleClass *t, SetData *set, OctetString *caller_gid)
-{
- verbose("RectangleClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: RectangleClass_SetData not yet implemented\n");
- return;
-}
-
-void
RectangleClass_Clone(RectangleClass *t, Clone *params, OctetString *caller_gid)
{
verbose("RectangleClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/RectangleClass.h
===================================================================
--- redbutton-browser/trunk/RectangleClass.h 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/RectangleClass.h 2007-03-28 14:30:28 UTC (rev 262)
@@ -12,7 +12,6 @@
void RectangleClass_Deactivation(RectangleClass *);
void RectangleClass_Destruction(RectangleClass *);
-void RectangleClass_SetData(RectangleClass *, SetData *, OctetString *);
void RectangleClass_Clone(RectangleClass *, Clone *, OctetString *);
void RectangleClass_SetPosition(RectangleClass *, SetPosition *, OctetString *);
void RectangleClass_GetPosition(RectangleClass *, GetPosition *, OctetString *);
Modified: redbutton-browser/trunk/SliderClass.c
===================================================================
--- redbutton-browser/trunk/SliderClass.c 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/SliderClass.c 2007-03-28 14:30:28 UTC (rev 262)
@@ -122,16 +122,6 @@
}
void
-SliderClass_SetData(SliderClass *t, SetData *set, OctetString *caller_gid)
-{
- verbose("SliderClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: SliderClass_SetData not yet implemented\n");
- return;
-}
-
-void
SliderClass_Clone(SliderClass *t, Clone *params, OctetString *caller_gid)
{
verbose("SliderClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/SliderClass.h
===================================================================
--- redbutton-browser/trunk/SliderClass.h 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/SliderClass.h 2007-03-28 14:30:28 UTC (rev 262)
@@ -12,7 +12,6 @@
void SliderClass_Deactivation(SliderClass *);
void SliderClass_Destruction(SliderClass *);
-void SliderClass_SetData(SliderClass *, SetData *, OctetString *);
void SliderClass_Clone(SliderClass *, Clone *, OctetString *);
void SliderClass_SetPosition(SliderClass *, SetPosition *, OctetString *);
void SliderClass_GetPosition(SliderClass *, GetPosition *, OctetString *);
Modified: redbutton-browser/trunk/TokenGroupClass.c
===================================================================
--- redbutton-browser/trunk/TokenGroupClass.c 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/TokenGroupClass.c 2007-03-28 14:30:28 UTC (rev 262)
@@ -138,16 +138,6 @@
}
void
-TokenGroupClass_SetData(TokenGroupClass *t, SetData *set, OctetString *caller_gid)
-{
- verbose("TokenGroupClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: TokenGroupClass_SetData not yet implemented\n");
- return;
-}
-
-void
TokenGroupClass_Clone(TokenGroupClass *t, Clone *params, OctetString *caller_gid)
{
verbose("TokenGroupClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/TokenGroupClass.h
===================================================================
--- redbutton-browser/trunk/TokenGroupClass.h 2007-03-28 14:16:19 UTC (rev 261)
+++ redbutton-browser/trunk/TokenGroupClass.h 2007-03-28 14:30:28 UTC (rev 262)
@@ -13,7 +13,6 @@
void TokenGroupClass_Destruction(TokenGroupClass *);
void TokenGroupClass_TransferToken(TokenGroupClass *, unsigned int);
-void TokenGroupClass_SetData(TokenGroupClass *, SetData *, OctetString *);
void TokenGroupClass_Clone(TokenGroupClass *, Clone *, OctetString *);
void TokenGroupClass_Move(TokenGroupClass *, Move *, OctetString *);
void TokenGroupClass_MoveTo(TokenGroupClass *, MoveTo *, OctetString *);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-28 14:16:23
|
Revision: 261
http://svn.sourceforge.net/redbutton/?rev=261&view=rev
Author: skilvington
Date: 2007-03-28 07:16:19 -0700 (Wed, 28 Mar 2007)
Log Message:
-----------
SetData can't be applied to objects with no ContentHook attribute
Modified Paths:
--------------
redbutton-browser/trunk/BooleanVariableClass.c
redbutton-browser/trunk/BooleanVariableClass.h
redbutton-browser/trunk/ContentRefVariableClass.c
redbutton-browser/trunk/ContentRefVariableClass.h
redbutton-browser/trunk/ElementaryAction.c
redbutton-browser/trunk/IntegerVariableClass.c
redbutton-browser/trunk/IntegerVariableClass.h
redbutton-browser/trunk/LinkClass.c
redbutton-browser/trunk/LinkClass.h
redbutton-browser/trunk/ObjectRefVariableClass.c
redbutton-browser/trunk/ObjectRefVariableClass.h
redbutton-browser/trunk/OctetStringVariableClass.c
redbutton-browser/trunk/OctetStringVariableClass.h
redbutton-browser/trunk/VariableClass.c
redbutton-browser/trunk/VariableClass.h
Modified: redbutton-browser/trunk/BooleanVariableClass.c
===================================================================
--- redbutton-browser/trunk/BooleanVariableClass.c 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/BooleanVariableClass.c 2007-03-28 14:16:19 UTC (rev 261)
@@ -13,16 +13,6 @@
#include "rtti.h"
void
-BooleanVariableClass_SetData(BooleanVariableClass *t, SetData *params, OctetString *caller_gid)
-{
- verbose("BooleanVariableClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: BooleanVariableClass_SetData not yet implemented\n");
- return;
-}
-
-void
BooleanVariableClass_Clone(BooleanVariableClass *t, Clone *params, OctetString *caller_gid)
{
verbose("BooleanVariableClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/BooleanVariableClass.h
===================================================================
--- redbutton-browser/trunk/BooleanVariableClass.h 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/BooleanVariableClass.h 2007-03-28 14:16:19 UTC (rev 261)
@@ -7,7 +7,6 @@
#include "ISO13522-MHEG-5.h"
-void BooleanVariableClass_SetData(BooleanVariableClass *, SetData *, OctetString *);
void BooleanVariableClass_Clone(BooleanVariableClass *, Clone *, OctetString *);
void BooleanVariableClass_SetVariable(BooleanVariableClass *, NewVariableValue *, OctetString *);
void BooleanVariableClass_TestVariable(BooleanVariableClass *, int, bool);
Modified: redbutton-browser/trunk/ContentRefVariableClass.c
===================================================================
--- redbutton-browser/trunk/ContentRefVariableClass.c 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/ContentRefVariableClass.c 2007-03-28 14:16:19 UTC (rev 261)
@@ -13,16 +13,6 @@
#include "rtti.h"
void
-ContentRefVariableClass_SetData(ContentRefVariableClass *t, SetData *params, OctetString *caller_gid)
-{
- verbose("ContentRefVariableClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: ContentRefVariableClass_SetData not yet implemented\n");
- return;
-}
-
-void
ContentRefVariableClass_Clone(ContentRefVariableClass *t, Clone *params, OctetString *caller_gid)
{
verbose("ContentRefVariableClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/ContentRefVariableClass.h
===================================================================
--- redbutton-browser/trunk/ContentRefVariableClass.h 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/ContentRefVariableClass.h 2007-03-28 14:16:19 UTC (rev 261)
@@ -7,7 +7,6 @@
#include "ISO13522-MHEG-5.h"
-void ContentRefVariableClass_SetData(ContentRefVariableClass *, SetData *, OctetString *);
void ContentRefVariableClass_Clone(ContentRefVariableClass *, Clone *, OctetString *);
void ContentRefVariableClass_SetVariable(ContentRefVariableClass *, NewVariableValue *, OctetString *);
void ContentRefVariableClass_TestVariable(ContentRefVariableClass *, int, ContentReference *);
Modified: redbutton-browser/trunk/ElementaryAction.c
===================================================================
--- redbutton-browser/trunk/ElementaryAction.c 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/ElementaryAction.c 2007-03-28 14:16:19 UTC (rev 261)
@@ -1183,11 +1183,7 @@
if(((ref = GenericObjectReference_getObjectReference(&e->u.set_data.target, caller_gid)) != NULL)
&& ((obj = MHEGEngine_findObjectReference(ref, caller_gid)) != NULL))
{
- if(obj->inst.rtti == RTTI_VariableClass)
- VariableClass_SetData((VariableClass *) obj, &e->u.set_data, caller_gid);
- else if(obj->inst.rtti == RTTI_LinkClass)
- LinkClass_SetData((LinkClass *) obj, &e->u.set_data, caller_gid);
- else if(obj->inst.rtti == RTTI_BitmapClass)
+ if(obj->inst.rtti == RTTI_BitmapClass)
BitmapClass_SetData((BitmapClass *) obj, &e->u.set_data, caller_gid);
else if(obj->inst.rtti == RTTI_DynamicLineArtClass)
DynamicLineArtClass_SetData((DynamicLineArtClass *) obj, &e->u.set_data, caller_gid);
Modified: redbutton-browser/trunk/IntegerVariableClass.c
===================================================================
--- redbutton-browser/trunk/IntegerVariableClass.c 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/IntegerVariableClass.c 2007-03-28 14:16:19 UTC (rev 261)
@@ -16,16 +16,6 @@
#include "rtti.h"
void
-IntegerVariableClass_SetData(IntegerVariableClass *t, SetData *params, OctetString *caller_gid)
-{
- verbose("IntegerVariableClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: IntegerVariableClass_SetData not yet implemented\n");
- return;
-}
-
-void
IntegerVariableClass_Clone(IntegerVariableClass *t, Clone *params, OctetString *caller_gid)
{
verbose("IntegerVariableClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/IntegerVariableClass.h
===================================================================
--- redbutton-browser/trunk/IntegerVariableClass.h 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/IntegerVariableClass.h 2007-03-28 14:16:19 UTC (rev 261)
@@ -7,7 +7,6 @@
#include "ISO13522-MHEG-5.h"
-void IntegerVariableClass_SetData(IntegerVariableClass *, SetData *, OctetString *);
void IntegerVariableClass_Clone(IntegerVariableClass *, Clone *, OctetString *);
void IntegerVariableClass_SetVariable(IntegerVariableClass *, NewVariableValue *, OctetString *);
void IntegerVariableClass_TestVariable(IntegerVariableClass *, int, int);
Modified: redbutton-browser/trunk/LinkClass.c
===================================================================
--- redbutton-browser/trunk/LinkClass.c 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/LinkClass.c 2007-03-28 14:16:19 UTC (rev 261)
@@ -87,16 +87,6 @@
}
void
-LinkClass_SetData(LinkClass *t, SetData *set, OctetString *caller_gid)
-{
- verbose("LinkClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: LinkClass_SetData not yet implemented\n");
- return;
-}
-
-void
LinkClass_Clone(LinkClass *t, Clone *params, OctetString *caller_gid)
{
verbose("LinkClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/LinkClass.h
===================================================================
--- redbutton-browser/trunk/LinkClass.h 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/LinkClass.h 2007-03-28 14:16:19 UTC (rev 261)
@@ -12,7 +12,6 @@
void LinkClass_Deactivation(LinkClass *);
void LinkClass_Destruction(LinkClass *);
-void LinkClass_SetData(LinkClass *, SetData *, OctetString *);
void LinkClass_Clone(LinkClass *, Clone *, OctetString *);
void LinkClass_Activate(LinkClass *);
void LinkClass_Deactivate(LinkClass *);
Modified: redbutton-browser/trunk/ObjectRefVariableClass.c
===================================================================
--- redbutton-browser/trunk/ObjectRefVariableClass.c 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/ObjectRefVariableClass.c 2007-03-28 14:16:19 UTC (rev 261)
@@ -13,16 +13,6 @@
#include "rtti.h"
void
-ObjectRefVariableClass_SetData(ObjectRefVariableClass *t, SetData *params, OctetString *caller_gid)
-{
- verbose("ObjectRefVariableClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: ObjectRefVariableClass_SetData not yet implemented\n");
- return;
-}
-
-void
ObjectRefVariableClass_Clone(ObjectRefVariableClass *t, Clone *params, OctetString *caller_gid)
{
verbose("ObjectRefVariableClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/ObjectRefVariableClass.h
===================================================================
--- redbutton-browser/trunk/ObjectRefVariableClass.h 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/ObjectRefVariableClass.h 2007-03-28 14:16:19 UTC (rev 261)
@@ -7,7 +7,6 @@
#include "ISO13522-MHEG-5.h"
-void ObjectRefVariableClass_SetData(ObjectRefVariableClass *, SetData *, OctetString *);
void ObjectRefVariableClass_Clone(ObjectRefVariableClass *, Clone *, OctetString *);
void ObjectRefVariableClass_SetVariable(ObjectRefVariableClass *, NewVariableValue *, OctetString *);
void ObjectRefVariableClass_TestVariable(ObjectRefVariableClass *, int, ObjectReference *, OctetString *);
Modified: redbutton-browser/trunk/OctetStringVariableClass.c
===================================================================
--- redbutton-browser/trunk/OctetStringVariableClass.c 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/OctetStringVariableClass.c 2007-03-28 14:16:19 UTC (rev 261)
@@ -17,16 +17,6 @@
#include "rtti.h"
void
-OctetStringVariableClass_SetData(OctetStringVariableClass *t, SetData *params, OctetString *caller_gid)
-{
- verbose("OctetStringVariableClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-printf("TODO: OctetStringVariableClass_SetData not yet implemented\n");
- return;
-}
-
-void
OctetStringVariableClass_Clone(OctetStringVariableClass *t, Clone *params, OctetString *caller_gid)
{
verbose("OctetStringVariableClass: %s; Clone", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/OctetStringVariableClass.h
===================================================================
--- redbutton-browser/trunk/OctetStringVariableClass.h 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/OctetStringVariableClass.h 2007-03-28 14:16:19 UTC (rev 261)
@@ -7,7 +7,6 @@
#include "ISO13522-MHEG-5.h"
-void OctetStringVariableClass_SetData(OctetStringVariableClass *, SetData *, OctetString *);
void OctetStringVariableClass_Clone(OctetStringVariableClass *, Clone *, OctetString *);
void OctetStringVariableClass_SetVariable(OctetStringVariableClass *, NewVariableValue *, OctetString *);
void OctetStringVariableClass_TestVariable(OctetStringVariableClass *, int, OctetString *);
Modified: redbutton-browser/trunk/VariableClass.c
===================================================================
--- redbutton-browser/trunk/VariableClass.c 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/VariableClass.c 2007-03-28 14:16:19 UTC (rev 261)
@@ -97,17 +97,6 @@
}
void
-VariableClass_SetData(VariableClass *t, SetData *set, OctetString *caller_gid)
-{
- verbose("VariableClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
-
-/* TODO */
-/* do we need the separate Boolean/Integer/etc/VariableClass_SetData funcs we have created? */
-printf("TODO: VariableClass_SetData not yet implemented\n");
- return;
-}
-
-void
VariableClass_Clone(VariableClass *t, Clone *clone, OctetString *caller_gid)
{
switch(t->inst.Value.choice)
Modified: redbutton-browser/trunk/VariableClass.h
===================================================================
--- redbutton-browser/trunk/VariableClass.h 2007-03-26 12:48:39 UTC (rev 260)
+++ redbutton-browser/trunk/VariableClass.h 2007-03-28 14:16:19 UTC (rev 261)
@@ -12,7 +12,6 @@
void VariableClass_Deactivation(VariableClass *);
void VariableClass_Destruction(VariableClass *);
-void VariableClass_SetData(VariableClass *, SetData *, OctetString *);
void VariableClass_Clone(VariableClass *, Clone *, OctetString *);
void VariableClass_SetVariable(VariableClass *, NewVariableValue *, OctetString *);
void VariableClass_TestVariable(VariableClass *, int, ComparisonValue *, OctetString *);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-26 13:02:25
|
Revision: 260
http://svn.sourceforge.net/redbutton/?rev=260&view=rev
Author: skilvington
Date: 2007-03-26 05:48:39 -0700 (Mon, 26 Mar 2007)
Log Message:
-----------
don't set PIDs until we are sure we could open the stream
Modified Paths:
--------------
redbutton-browser/trunk/MHEGBackend.c
Modified: redbutton-browser/trunk/MHEGBackend.c
===================================================================
--- redbutton-browser/trunk/MHEGBackend.c 2007-03-25 17:52:09 UTC (rev 259)
+++ redbutton-browser/trunk/MHEGBackend.c 2007-03-26 12:48:39 UTC (rev 260)
@@ -256,11 +256,6 @@
return NULL;
}
- if(have_audio)
- *audio_tag = audio_pid;
- if(have_video)
- *video_tag = video_pid;
-
/* set up the MHEGStream */
stream = safe_malloc(sizeof(MHEGStream));
@@ -298,6 +293,12 @@
stream->demux = NULL;
}
+ /* now we are sure it all worked, set up the return values */
+ if(have_audio)
+ *audio_tag = audio_pid;
+ if(have_video)
+ *video_tag = video_pid;
+
return stream;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-25 17:52:10
|
Revision: 259
http://svn.sourceforge.net/redbutton/?rev=259&view=rev
Author: skilvington
Date: 2007-03-25 10:52:09 -0700 (Sun, 25 Mar 2007)
Log Message:
-----------
get the dvr device name right
Modified Paths:
--------------
redbutton-browser/trunk/MHEGBackend.c
redbutton-browser/trunk/TODO
Modified: redbutton-browser/trunk/MHEGBackend.c
===================================================================
--- redbutton-browser/trunk/MHEGBackend.c 2007-03-25 09:51:05 UTC (rev 258)
+++ redbutton-browser/trunk/MHEGBackend.c 2007-03-25 17:52:09 UTC (rev 259)
@@ -207,6 +207,7 @@
unsigned int video_pid = 0;
bool err;
char *ts_dev;
+ int tail;
/* are the backend and frontend on the same host */
loopback = (t->addr.sin_addr.s_addr == htonl(INADDR_LOOPBACK));
@@ -278,6 +279,10 @@
return NULL;
}
ts_dev = pids + 7;
+ /* chop off any trailing \n */
+ tail = strlen(ts_dev) - 1;
+ while(tail > 0 && ts_dev[tail] == '\n')
+ ts_dev[tail--] = '\0';
if((stream->ts = fopen(ts_dev, "r")) == NULL)
{
fclose(be);
Modified: redbutton-browser/trunk/TODO
===================================================================
--- redbutton-browser/trunk/TODO 2007-03-25 09:51:05 UTC (rev 258)
+++ redbutton-browser/trunk/TODO 2007-03-25 17:52:09 UTC (rev 259)
@@ -1,9 +1,3 @@
-openStream:
-if "remote" backend is 127.0.0.1, open dvr device in rb-browser
-- ask rb-download to set the PID filters, it returns the dvr dev name
-- when connection is closed, rb-download clears filters
-
-
posix_fadvise() when streaming data from the backend?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-25 09:51:07
|
Revision: 258
http://svn.sourceforge.net/redbutton/?rev=258&view=rev
Author: skilvington
Date: 2007-03-25 02:51:05 -0700 (Sun, 25 Mar 2007)
Log Message:
-----------
don't send A/V streams through the IP stack if the backend and frontend are on the same host
Modified Paths:
--------------
redbutton-browser/trunk/MHEGBackend.c
redbutton-browser/trunk/MHEGBackend.h
redbutton-browser/trunk/MHEGEngine.c
redbutton-browser/trunk/MHEGEngine.h
redbutton-browser/trunk/MHEGStreamPlayer.c
redbutton-browser/trunk/MHEGStreamPlayer.h
Modified: redbutton-browser/trunk/MHEGBackend.c
===================================================================
--- redbutton-browser/trunk/MHEGBackend.c 2007-03-25 09:07:27 UTC (rev 257)
+++ redbutton-browser/trunk/MHEGBackend.c 2007-03-25 09:51:05 UTC (rev 258)
@@ -14,11 +14,22 @@
#include "si.h"
#include "utils.h"
+/* internal functions */
+static FILE *remote_command(MHEGBackend *, bool, char *);
+static unsigned int remote_response(FILE *);
+
+static MHEGStream *open_stream(MHEGBackend *, int, bool, int *, int *, bool, int *, int *);
+static void close_stream(MHEGBackend *, MHEGStream *);
+
+static int parse_addr(char *, struct in_addr *, in_port_t *);
+static int get_host_addr(char *, struct in_addr *);
+
+static char *external_filename(MHEGBackend *, OctetString *);
+
/* local backend funcs */
bool local_checkContentRef(MHEGBackend *, ContentReference *);
bool local_loadFile(MHEGBackend *, OctetString *, OctetString *);
FILE *local_openFile(MHEGBackend *, OctetString *);
-FILE *local_openStream(MHEGBackend *, int, bool, int *, int *, bool, int *, int *);
void local_retune(MHEGBackend *, OctetString *);
static struct MHEGBackendFns local_backend_fns =
@@ -26,7 +37,8 @@
local_checkContentRef, /* checkContentRef */
local_loadFile, /* loadFile */
local_openFile, /* openFile */
- local_openStream, /* openStream */
+ open_stream, /* openStream */
+ close_stream, /* closeStream */
local_retune, /* retune */
};
@@ -34,7 +46,6 @@
bool remote_checkContentRef(MHEGBackend *, ContentReference *);
bool remote_loadFile(MHEGBackend *, OctetString *, OctetString *);
FILE *remote_openFile(MHEGBackend *, OctetString *);
-FILE *remote_openStream(MHEGBackend *, int, bool, int *, int *, bool, int *, int *);
void remote_retune(MHEGBackend *, OctetString *);
static struct MHEGBackendFns remote_backend_fns =
@@ -42,19 +53,11 @@
remote_checkContentRef, /* checkContentRef */
remote_loadFile, /* loadFile */
remote_openFile, /* openFile */
- remote_openStream, /* openStream */
+ open_stream, /* openStream */
+ close_stream, /* closeStream */
remote_retune, /* retune */
};
-/* internal functions */
-static int parse_addr(char *, struct in_addr *, in_port_t *);
-static int get_host_addr(char *, struct in_addr *);
-
-static FILE *remote_command(MHEGBackend *, bool, char *);
-static unsigned int remote_response(FILE *);
-
-static char *external_filename(MHEGBackend *, OctetString *);
-
/* public interface */
void
MHEGBackend_init(MHEGBackend *b, bool remote, char *srg_loc)
@@ -103,60 +106,6 @@
}
/*
- * extract the IP addr and port number from a string in one of these forms:
- * host:port
- * ip-addr:port
- * host
- * ip-addr
- * if the port is not defined in the string, the value passed to this routine is unchanged
- * ip and port are both returned in network byte order
- * returns -1 on error (can't resolve host name)
- */
-
-static int
-parse_addr(char *str, struct in_addr *ip, in_port_t *port)
-{
- char *p;
-
- if((p = strchr(str, ':')) != NULL)
- {
- /* its either host:port or ip:port */
- *(p++) = '\0';
- if(get_host_addr(str, ip) < 0)
- return -1;
- *port = htons(atoi(p));
- /* reconstruct the string */
- *(--p) = ':';
- }
- else if(get_host_addr(str, ip) < 0)
- {
- return -1;
- }
-
- return 0;
-}
-
-/*
- * puts the IP address associated with the given host into output buffer
- * host can be a.b.c.d or a host name
- * returns 0 if successful, -1 on error
- */
-
-static int
-get_host_addr(char *host, struct in_addr *output)
-{
- struct hostent *he;
- int error = 0;
-
- if(((he = gethostbyname(host)) != NULL) && (he->h_addrtype == AF_INET))
- memcpy(output, he->h_addr, sizeof(struct in_addr));
- else
- error = -1;
-
- return error;
-}
-
-/*
* send the given command to the remote backend
* if reuse is true, reuse the existing connection to the backend
* returns a socket FILE to read the response from
@@ -232,6 +181,193 @@
}
/*
+ * return a read-only FILE handle for an MPEG Transport Stream (in MHEGStream->ts)
+ * the TS will contain an audio stream (if have_audio is true) and a video stream (if have_video is true)
+ * the *audio_tag and *video_tag numbers refer to Component/Association Tag values from the DVB PMT
+ * if *audio_tag or *video_tag is -1, the default audio and/or video stream for the given Service ID is used
+ * if service_id is -1, it uses the Service ID we are downloading the carousel from
+ * updates *audio_tag and/or *video_tag to the actual PIDs in the Transport Stream
+ * updates *audio_type and/or *video_type to the stream type IDs
+ * returns NULL on error
+ */
+
+static MHEGStream *
+open_stream(MHEGBackend *t,
+ int service_id,
+ bool have_audio, int *audio_tag, int *audio_type,
+ bool have_video, int *video_tag, int *video_type)
+{
+ MHEGStream *stream;
+ bool loopback;
+ char *avcmd;
+ char cmd[PATH_MAX];
+ FILE *be;
+ char pids[PATH_MAX];
+ unsigned int audio_pid = 0;
+ unsigned int video_pid = 0;
+ bool err;
+ char *ts_dev;
+
+ /* are the backend and frontend on the same host */
+ loopback = (t->addr.sin_addr.s_addr == htonl(INADDR_LOOPBACK));
+ if(loopback)
+ avcmd = "demux";
+ else
+ avcmd = "stream";
+
+ /* no PIDs required */
+ if(!have_audio && !have_video)
+ return NULL;
+ /* video and audio */
+ else if(have_audio && have_video)
+ snprintf(cmd, sizeof(cmd), "av%s %d %d %d\n", avcmd, service_id, *audio_tag, *video_tag);
+ /* audio only */
+ else if(have_audio)
+ snprintf(cmd, sizeof(cmd), "a%s %d %d\n", avcmd, service_id, *audio_tag);
+ /* video only */
+ else
+ snprintf(cmd, sizeof(cmd), "v%s %d %d\n", avcmd, service_id, *video_tag);
+
+ /* false => create a new connection to the backend */
+ if((be = remote_command(t, false, cmd)) == NULL)
+ return NULL;
+
+ /* did it work */
+ if(remote_response(be) != BACKEND_RESPONSE_OK
+ || fgets(pids, sizeof(pids), be) == NULL)
+ {
+ fclose(be);
+ return NULL;
+ }
+
+ /* update the PID variables */
+ if(have_audio && have_video)
+ err = (sscanf(pids, "AudioPID %u AudioType %u VideoPID %u VideoType %u",
+ &audio_pid, audio_type, &video_pid, video_type) != 4);
+ else if(have_audio)
+ err = (sscanf(pids, "AudioPID %u AudioType %u", &audio_pid, audio_type) != 2);
+ else
+ err = (sscanf(pids, "VideoPID %u VideoType %u", &video_pid, video_type) != 2);
+
+ if(err)
+ {
+ fclose(be);
+ return NULL;
+ }
+
+ if(have_audio)
+ *audio_tag = audio_pid;
+ if(have_video)
+ *video_tag = video_pid;
+
+ /* set up the MHEGStream */
+ stream = safe_malloc(sizeof(MHEGStream));
+
+ /*
+ * if we sent a "demux" command, open the DVR device
+ * if we sent a "stream" command, the TS is streamed from the backend
+ */
+ if(loopback)
+ {
+ /* backend tells us where the DVR device is */
+ if(fgets(pids, sizeof(pids), be) == NULL
+ || strncmp(pids, "Device ", 7) != 0)
+ {
+ fclose(be);
+ safe_free(stream);
+ return NULL;
+ }
+ ts_dev = pids + 7;
+ if((stream->ts = fopen(ts_dev, "r")) == NULL)
+ {
+ fclose(be);
+ safe_free(stream);
+ return NULL;
+ }
+ /* backend keeps the PID filters in place until we close this connection */
+ stream->demux = be;
+ }
+ else
+ {
+ stream->ts = be;
+ stream->demux = NULL;
+ }
+
+ return stream;
+}
+
+static void
+close_stream(MHEGBackend *t, MHEGStream *stream)
+{
+ if(stream == NULL)
+ return;
+
+ if(stream->ts != NULL)
+ fclose(stream->ts);
+
+ if(stream->demux != NULL)
+ fclose(stream->demux);
+
+ safe_free(stream);
+
+ return;
+}
+
+/*
+ * extract the IP addr and port number from a string in one of these forms:
+ * host:port
+ * ip-addr:port
+ * host
+ * ip-addr
+ * if the port is not defined in the string, the value passed to this routine is unchanged
+ * ip and port are both returned in network byte order
+ * returns -1 on error (can't resolve host name)
+ */
+
+static int
+parse_addr(char *str, struct in_addr *ip, in_port_t *port)
+{
+ char *p;
+
+ if((p = strchr(str, ':')) != NULL)
+ {
+ /* its either host:port or ip:port */
+ *(p++) = '\0';
+ if(get_host_addr(str, ip) < 0)
+ return -1;
+ *port = htons(atoi(p));
+ /* reconstruct the string */
+ *(--p) = ':';
+ }
+ else if(get_host_addr(str, ip) < 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * puts the IP address associated with the given host into output buffer
+ * host can be a.b.c.d or a host name
+ * returns 0 if successful, -1 on error
+ */
+
+static int
+get_host_addr(char *host, struct in_addr *output)
+{
+ struct hostent *he;
+ int error = 0;
+
+ if(((he = gethostbyname(host)) != NULL) && (he->h_addrtype == AF_INET))
+ memcpy(output, he->h_addr, sizeof(struct in_addr));
+ else
+ error = -1;
+
+ return error;
+}
+
+/*
* returns a filename that can be loaded from the file system
* ie ~// at the start of the absolute name is replaced with base_dir
* returns a ptr to a static string that will be overwritten by the next call to this routine
@@ -330,31 +466,6 @@
}
/*
- * return a read-only FILE handle for an MPEG Transport Stream
- * the TS will contain an audio stream (if have_audio is true) and a video stream (if have_video is true)
- * the *audio_tag and *video_tag numbers refer to Component/Association Tag values from the DVB PMT
- * if *audio_tag or *video_tag is -1, the default audio and/or video stream for the given Service ID is used
- * if service_id is -1, it uses the Service ID we are downloading the carousel from
- * updates *audio_tag and/or *video_tag to the actual PIDs in the Transport Stream
- * updates *audio_type and/or *video_type to the stream type IDs
- * returns NULL on error
- */
-
-FILE *
-local_openStream(MHEGBackend *t, int service_id, bool have_audio, int *audio_tag, int *audio_type, bool have_video, int *video_tag, int *video_type)
-{
- /*
- * we need to convert the audio/video_tag into PIDs
- * we could either:
- * 1. parse the PMT ourselves, and open the DVB device ourselves
- * 2. have a backend command to convert Component Tags to PIDs, then open the DVB device ourselves
- * 3. just stream the TS from the backend
- * we choose 3, to avoid duplicating code and having to pass "-d <device>" options etc
- */
- return remote_openStream(t, service_id, have_audio, audio_tag, audio_type, have_video, video_tag, video_type);
-}
-
-/*
* retune the backend to the given service
* service should be in the form "dvb://<network_id>..<service_id>", eg "dvb://233a..4C80"
*/
@@ -520,77 +631,6 @@
}
/*
- * return a read-only FILE handle for an MPEG Transport Stream
- * the TS will contain an audio stream (if have_audio is true) and a video stream (if have_video is true)
- * the *audio_tag and *video_tag numbers refer to Component/Association Tag values from the DVB PMT
- * if *audio_tag or *video_tag is -1, the default audio and/or video stream for the given Service ID is used
- * if service_id is -1, it uses the Service ID we are downloading the carousel from
- * updates *audio_tag and/or *video_tag to the actual PIDs in the Transport Stream
- * updates *audio_type and/or *video_type to the stream type IDs
- * returns NULL on error
- */
-
-FILE *
-remote_openStream(MHEGBackend *t, int service_id, bool have_audio, int *audio_tag, int *audio_type, bool have_video, int *video_tag, int *video_type)
-{
- char cmd[PATH_MAX];
- FILE *sock;
- char pids[128];
- unsigned int audio_pid = 0;
- unsigned int video_pid = 0;
- bool err;
-
- /* no PIDs required */
- if(!have_audio && !have_video)
- return NULL;
- /* video and audio */
- else if(have_audio && have_video)
- snprintf(cmd, sizeof(cmd), "avstream %d %d %d\n", service_id, *audio_tag, *video_tag);
- /* audio only */
- else if(have_audio)
- snprintf(cmd, sizeof(cmd), "astream %d %d\n", service_id, *audio_tag);
- /* video only */
- else
- snprintf(cmd, sizeof(cmd), "vstream %d %d\n", service_id, *video_tag);
-
- /* false => create a new connection to the backend */
- if((sock = remote_command(t, false, cmd)) == NULL)
- return NULL;
-
- /* did it work */
- if(remote_response(sock) != BACKEND_RESPONSE_OK
- || fgets(pids, sizeof(pids), sock) == NULL)
- {
- fclose(sock);
- return NULL;
- }
-
- /* update the PID variables */
- if(have_audio && have_video)
- err = (sscanf(pids, "AudioPID %u AudioType %u VideoPID %u VideoType %u",
- &audio_pid, audio_type, &video_pid, video_type) != 4);
- else if(have_audio)
- err = (sscanf(pids, "AudioPID %u AudioType %u", &audio_pid, audio_type) != 2);
- else
- err = (sscanf(pids, "VideoPID %u VideoType %u", &video_pid, video_type) != 2);
-
- if(!err)
- {
- if(have_audio)
- *audio_tag = audio_pid;
- if(have_video)
- *video_tag = video_pid;
- }
- else
- {
- fclose(sock);
- sock = NULL;
- }
-
- return sock;
-}
-
-/*
* retune the backend to the given service
* service should be in the form "dvb://<network_id>..<service_id>", eg "dvb://233a..4C80"
*/
Modified: redbutton-browser/trunk/MHEGBackend.h
===================================================================
--- redbutton-browser/trunk/MHEGBackend.h 2007-03-25 09:07:27 UTC (rev 257)
+++ redbutton-browser/trunk/MHEGBackend.h 2007-03-25 09:51:05 UTC (rev 258)
@@ -14,6 +14,13 @@
#define DEFAULT_BACKEND "127.0.0.1"
+/* MPEG Transport Stream */
+typedef struct
+{
+ FILE *ts; /* the Transport Stream */
+ FILE *demux; /* private */
+} MHEGStream;
+
typedef struct MHEGBackend
{
char *base_dir; /* local Service Gateway root directory */
@@ -29,7 +36,9 @@
/* open a carousel file */
FILE *(*openFile)(struct MHEGBackend *, OctetString *);
/* open an MPEG Transport Stream */
- FILE *(*openStream)(struct MHEGBackend *, int, bool, int *, int *, bool, int *, int *);
+ MHEGStream *(*openStream)(struct MHEGBackend *, int, bool, int *, int *, bool, int *, int *);
+ /* close an MPEG Transport Stream */
+ void (*closeStream)(struct MHEGBackend *, MHEGStream *);
/* tune to the given service */
void (*retune)(struct MHEGBackend *, OctetString *);
} *fns;
Modified: redbutton-browser/trunk/MHEGEngine.c
===================================================================
--- redbutton-browser/trunk/MHEGEngine.c 2007-03-25 09:07:27 UTC (rev 257)
+++ redbutton-browser/trunk/MHEGEngine.c 2007-03-25 09:51:05 UTC (rev 258)
@@ -1415,7 +1415,7 @@
* returns NULL on error
*/
-FILE *
+MHEGStream *
MHEGEngine_openStream(int service_id, bool have_audio, int *audio_tag, int *audio_type, bool have_video, int *video_tag, int *video_type)
{
return (*(engine.backend.fns->openStream))(&engine.backend,
@@ -1424,6 +1424,12 @@
have_video, video_tag, video_type);
}
+void
+MHEGEngine_closeStream(MHEGStream *stream)
+{
+ return (*(engine.backend.fns->closeStream))(&engine.backend, stream);
+}
+
/*
* retune the backend to the given service
* service should be in the form "dvb://<network_id>..<service_id>", eg "dvb://233a..4C80"
Modified: redbutton-browser/trunk/MHEGEngine.h
===================================================================
--- redbutton-browser/trunk/MHEGEngine.h 2007-03-25 09:07:27 UTC (rev 257)
+++ redbutton-browser/trunk/MHEGEngine.h 2007-03-25 09:51:05 UTC (rev 258)
@@ -239,7 +239,8 @@
bool MHEGEngine_checkContentRef(ContentReference *);
bool MHEGEngine_loadFile(OctetString *, OctetString *);
FILE *MHEGEngine_openFile(OctetString *);
-FILE *MHEGEngine_openStream(int, bool, int *, int *, bool, int *, int *);
+MHEGStream *MHEGEngine_openStream(int, bool, int *, int *, bool, int *, int *);
+void MHEGEngine_closeStream(MHEGStream *);
void MHEGEngine_retune(OctetString *);
char *MHEGEngine_absoluteFilename(OctetString *);
Modified: redbutton-browser/trunk/MHEGStreamPlayer.c
===================================================================
--- redbutton-browser/trunk/MHEGStreamPlayer.c 2007-03-25 09:07:27 UTC (rev 257)
+++ redbutton-browser/trunk/MHEGStreamPlayer.c 2007-03-25 09:51:05 UTC (rev 258)
@@ -342,7 +342,7 @@
if(p->ts != NULL)
{
- fclose(p->ts);
+ MHEGEngine_closeStream(p->ts);
p->ts = NULL;
}
@@ -415,10 +415,10 @@
demux_apid = p->have_audio ? p->audio_pid : -1;
demux_vpid = p->have_video ? p->video_pid : -1;
- if((tsdemux = mpegts_open(p->ts, demux_apid, demux_vpid)) == NULL)
+ if((tsdemux = mpegts_open(p->ts->ts, demux_apid, demux_vpid)) == NULL)
fatal("Out of memory");
- while(!p->stop && !feof(p->ts))
+ while(!p->stop && !feof(p->ts->ts))
{
/* get the next complete packet for one of the streams */
if(mpegts_demux_frame(tsdemux, &pkt) < 0)
Modified: redbutton-browser/trunk/MHEGStreamPlayer.h
===================================================================
--- redbutton-browser/trunk/MHEGStreamPlayer.h 2007-03-25 09:07:27 UTC (rev 257)
+++ redbutton-browser/trunk/MHEGStreamPlayer.h 2007-03-25 09:51:05 UTC (rev 258)
@@ -12,6 +12,7 @@
#include <ffmpeg/avcodec.h>
#include "ISO13522-MHEG-5.h"
+#include "MHEGBackend.h"
/* seconds of video to buffer before we start playing it */
#define INIT_VIDEO_BUFFER_WAIT 1.0
@@ -66,7 +67,7 @@
int audio_pid; /* PID in MPEG Transport Stream (-1 => not yet known) */
int audio_type; /* audio stream type (-1 => not yet known) */
AVCodecContext *audio_codec; /* audio ouput params */
- FILE *ts; /* MPEG Transport Stream */
+ MHEGStream *ts; /* MPEG Transport Stream */
pthread_t decode_tid; /* thread decoding the MPEG stream into audio/video frames */
pthread_t video_tid; /* thread displaying video frames on the screen */
pthread_t audio_tid; /* thread feeding audio frames into the sound card */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-25 09:07:30
|
Revision: 257
http://svn.sourceforge.net/redbutton/?rev=257&view=rev
Author: skilvington
Date: 2007-03-25 02:07:27 -0700 (Sun, 25 Mar 2007)
Log Message:
-----------
add {a,v,av}demux commands
Modified Paths:
--------------
redbutton-download/trunk/command.c
Modified: redbutton-download/trunk/command.c
===================================================================
--- redbutton-download/trunk/command.c 2007-03-25 08:35:04 UTC (rev 256)
+++ redbutton-download/trunk/command.c 2007-03-25 09:07:27 UTC (rev 257)
@@ -25,13 +25,16 @@
/* the commands */
bool cmd_assoc(struct listen_data *, FILE *, int, char **);
+bool cmd_ademux(struct listen_data *, FILE *, int, char **);
bool cmd_astream(struct listen_data *, FILE *, int, char **);
+bool cmd_avdemux(struct listen_data *, FILE *, int, char **);
bool cmd_avstream(struct listen_data *, FILE *, int, char **);
bool cmd_check(struct listen_data *, FILE *, int, char **);
bool cmd_file(struct listen_data *, FILE *, int, char **);
bool cmd_help(struct listen_data *, FILE *, int, char **);
bool cmd_quit(struct listen_data *, FILE *, int, char **);
bool cmd_retune(struct listen_data *, FILE *, int, char **);
+bool cmd_vdemux(struct listen_data *, FILE *, int, char **);
bool cmd_vstream(struct listen_data *, FILE *, int, char **);
static struct
@@ -43,7 +46,9 @@
} command[] =
{
{ "assoc", "", cmd_assoc, "List component tag to PID mappings" },
+ { "ademux", "[<ServiceID>] <ComponentTag>", cmd_ademux, "Demux the given audio component tag" },
{ "astream", "[<ServiceID>] <ComponentTag>", cmd_astream, "Stream the given audio component tag" },
+ { "avdemux", "[<ServiceID>] <AudioTag> <VideoTag>", cmd_avdemux, "Demux the given audio and video component tags" },
{ "avstream", "[<ServiceID>] <AudioTag> <VideoTag>", cmd_avstream, "Stream the given audio and video component tags" },
{ "check", "<ContentReference>", cmd_check, "Check if the given file exists on the carousel" },
{ "exit", "", cmd_quit, "Close the connection" },
@@ -51,6 +56,7 @@
{ "help", "", cmd_help, "List available commands" },
{ "quit", "", cmd_quit, "Close the connection" },
{ "retune", "<ServiceID>", cmd_retune, "Start downloading the carousel from ServiceID" },
+ { "vdemux", "[<ServiceID>] <ComponentTag>", cmd_vdemux, "Demux the given video component tag" },
{ "vstream", "[<ServiceID>] <ComponentTag>", cmd_vstream, "Stream the given video component tag" },
{ NULL, NULL, NULL, NULL }
};
@@ -176,6 +182,80 @@
}
/*
+ * ademux [<service_id>] <tag>
+ * add the given audio stream to the PID filter
+ * return the name of the dvr device to read the transport stream from
+ * if service_id is not specified or is -1, use the service we are downloading the carousel from
+ * the tag should be an association/component_tag number as found in the PMT
+ * the tag is converted to a PID and that PID is used as a demux filter
+ * if tag is -1, the default audio stream for the service_id is used
+ */
+
+bool
+cmd_ademux(struct listen_data *listen_data, FILE *client, int argc, char *argv[])
+{
+ struct carousel *car = listen_data->carousel;
+ int service;
+ int tag;
+ struct avstreams *streams;
+ int audio_fd;
+ char hdr[64];
+
+ CHECK_VUSAGE(2, 3, "ademux [<ServiceID>] <ComponentTag>");
+
+ if(argc == 2)
+ {
+ service = -1;
+ tag = strtol(argv[1], NULL, 0);
+ }
+ else
+ {
+ service = strtol(argv[1], NULL, 0);
+ tag = strtol(argv[2], NULL, 0);
+ }
+
+ streams = find_avstreams(car, service, tag, -1);
+
+ /* check we have a default stream */
+ if(streams->audio_pid == 0)
+ {
+ SEND_RESPONSE(500, "Unable to resolve audio PID");
+ return false;
+ }
+
+ /* add the PID to the demux device */
+ if((audio_fd = add_demux_filter(car->demux_device, streams->audio_pid, DMX_PES_AUDIO)) < 0)
+ {
+ SEND_RESPONSE(500, "Unable to open audio PID");
+ return false;
+ }
+
+ /* send the OK code */
+ SEND_RESPONSE(200, "OK");
+
+ /* tell the client what PID and stream type the component tag resolved to */
+ snprintf(hdr, sizeof(hdr), "AudioPID %u AudioType %u\n", streams->audio_pid, streams->audio_type);
+ fputs(hdr, client);
+
+ /* tell the client where the dvr device is */
+ snprintf(hdr, sizeof(hdr), "Device %s\n", car->dvr_device);
+ fputs(hdr, client);
+
+ fflush(client);
+
+ /* keep the filter in place until the client closes or we get an error */
+ while(!feof(client))
+ sleep(1);
+
+ /* clean up */
+ ioctl(audio_fd, DMX_STOP);
+ close(audio_fd);
+
+ /* close the connection */
+ return true;
+}
+
+/*
* astream [<service_id>] <tag>
* send the given audio stream down the connection
* if service_id is not specified or is -1, use the service we are downloading the carousel from
@@ -252,6 +332,80 @@
}
/*
+ * vdemux [<service_id>] <tag>
+ * add the given video stream to the PID filter
+ * return the name of the dvr device to read the transport stream from
+ * if service_id is not specified or is -1, use the service we are downloading the carousel from
+ * the tag should be an association/component_tag number as found in the PMT
+ * the tag is converted to a PID and that PID is used as a demux filter
+ * if tag is -1, the default video stream for the service_id is used
+ */
+
+bool
+cmd_vdemux(struct listen_data *listen_data, FILE *client, int argc, char *argv[])
+{
+ struct carousel *car = listen_data->carousel;
+ int service;
+ int tag;
+ struct avstreams *streams;
+ int video_fd;
+ char hdr[64];
+
+ CHECK_VUSAGE(2, 3, "vdemux [<ServiceID>] <ComponentTag>");
+
+ if(argc == 2)
+ {
+ service = -1;
+ tag = strtol(argv[1], NULL, 0);
+ }
+ else
+ {
+ service = strtol(argv[1], NULL, 0);
+ tag = strtol(argv[2], NULL, 0);
+ }
+
+ streams = find_avstreams(car, service, -1, tag);
+
+ /* check we have a default stream */
+ if(streams->video_pid == 0)
+ {
+ SEND_RESPONSE(500, "Unable to resolve video PID");
+ return false;
+ }
+
+ /* add the PID to the demux device */
+ if((video_fd = add_demux_filter(car->demux_device, streams->video_pid, DMX_PES_VIDEO)) < 0)
+ {
+ SEND_RESPONSE(500, "Unable to open video PID");
+ return false;
+ }
+
+ /* send the OK code */
+ SEND_RESPONSE(200, "OK");
+
+ /* tell the client what PID and stream type the component tag resolved to */
+ snprintf(hdr, sizeof(hdr), "VideoPID %u VideoType %u\n", streams->video_pid, streams->video_type);
+ fputs(hdr, client);
+
+ /* tell the client where the dvr device is */
+ snprintf(hdr, sizeof(hdr), "Device %s\n", car->dvr_device);
+ fputs(hdr, client);
+
+ fflush(client);
+
+ /* keep the filter in place until the client closes or we get an error */
+ while(!feof(client))
+ sleep(1);
+
+ /* clean up */
+ ioctl(video_fd, DMX_STOP);
+ close(video_fd);
+
+ /* close the connection */
+ return true;
+}
+
+/*
* vstream [<service_id>] <tag>
* send the given video stream down the connection
* if service_id is not specified or is -1, use the service we are downloading the carousel from
@@ -328,6 +482,97 @@
}
/*
+ * avdemux <audio_tag> <video_tag>
+ * add the given audio and video streams to the PID filter
+ * if service_id is not specified or is -1, use the service we are downloading the carousel from
+ * the tags should be association/component_tag numbers as found in the PMT
+ * the tags are converted to PIDs and those PIDs are used as the demux filter
+ * if a tag is -1, the default audio or video stream for the service_id is used
+ */
+
+bool
+cmd_avdemux(struct listen_data *listen_data, FILE *client, int argc, char *argv[])
+{
+ struct carousel *car = listen_data->carousel;
+ int service;
+ int audio_tag;
+ int video_tag;
+ struct avstreams *streams;
+ int audio_fd;
+ int video_fd;
+ char hdr[64];
+
+ CHECK_VUSAGE(3, 4, "avdemux [<ServiceID>] <AudioTag> <VideoTag>");
+
+ if(argc == 3)
+ {
+ service = -1;
+ audio_tag = strtol(argv[1], NULL, 0);
+ video_tag = strtol(argv[2], NULL, 0);
+ }
+ else
+ {
+ service = strtol(argv[1], NULL, 0);
+ audio_tag = strtol(argv[2], NULL, 0);
+ video_tag = strtol(argv[3], NULL, 0);
+ }
+
+ streams = find_avstreams(car, service, audio_tag, video_tag);
+
+ /* check we have a default stream */
+ if(streams->audio_pid == 0)
+ {
+ SEND_RESPONSE(500, "Unable to resolve audio PID");
+ return false;
+ }
+ if(streams->video_pid == 0)
+ {
+ SEND_RESPONSE(500, "Unable to resolve video PID");
+ return false;
+ }
+
+ /* add the PIDs to the demux device */
+ if((audio_fd = add_demux_filter(car->demux_device, streams->audio_pid, DMX_PES_AUDIO)) < 0)
+ {
+ SEND_RESPONSE(500, "Unable to open audio PID");
+ return false;
+ }
+ if((video_fd = add_demux_filter(car->demux_device, streams->video_pid, DMX_PES_VIDEO)) < 0)
+ {
+ SEND_RESPONSE(500, "Unable to open video PID");
+ close(audio_fd);
+ return false;
+ }
+
+ /* send the OK code */
+ SEND_RESPONSE(200, "OK");
+
+ /* tell the client what PIDs and stream types the component tags resolved to */
+ snprintf(hdr, sizeof(hdr), "AudioPID %u AudioType %u VideoPID %u VideoType %u\n",
+ streams->audio_pid, streams->audio_type, streams->video_pid, streams->video_type);
+ fputs(hdr, client);
+
+ /* tell the client where the dvr device is */
+ snprintf(hdr, sizeof(hdr), "Device %s\n", car->dvr_device);
+ fputs(hdr, client);
+
+ fflush(client);
+
+ /* keep the filter in place until the client closes or we get an error */
+ while(!feof(client))
+ sleep(1);
+
+ /* clean up */
+ ioctl(audio_fd, DMX_STOP);
+ ioctl(video_fd, DMX_STOP);
+ close(audio_fd);
+ close(video_fd);
+
+ /* close the connection */
+ return true;
+}
+
+/*
* avstream <audio_tag> <video_tag>
* send the given audio and video streams down the connection
* if service_id is not specified or is -1, use the service we are downloading the carousel from
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-25 08:35:08
|
Revision: 256
http://svn.sourceforge.net/redbutton/?rev=256&view=rev
Author: skilvington
Date: 2007-03-25 01:35:04 -0700 (Sun, 25 Mar 2007)
Log Message:
-----------
terminate assoc output
Modified Paths:
--------------
redbutton-download/trunk/command.c
Modified: redbutton-download/trunk/command.c
===================================================================
--- redbutton-download/trunk/command.c 2007-03-23 13:51:06 UTC (rev 255)
+++ redbutton-download/trunk/command.c 2007-03-25 08:35:04 UTC (rev 256)
@@ -158,7 +158,6 @@
SEND_RESPONSE(200, "OK");
- /* if this is ever used by rb-browser, you will need to send a length first */
fprintf(client, "Tag\tPID\tType\n");
fprintf(client, "===\t===\t====\n");
@@ -170,6 +169,9 @@
for(i=0; i<car->assoc.nassocs; i++)
fprintf(client, "%u\t%u\t%u\n", car->assoc.sids[i], car->assoc.pids[i], car->assoc.types[i]);
+ /* terminator */
+ fprintf(client, ".\n");
+
return false;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-23 13:51:07
|
Revision: 255
http://svn.sourceforge.net/redbutton/?rev=255&view=rev
Author: skilvington
Date: 2007-03-23 06:51:06 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
don't draw polygons/lines with no edges
Modified Paths:
--------------
redbutton-browser/trunk/MHEGCanvas.c
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-23 13:45:24 UTC (rev 254)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-23 13:51:06 UTC (rev 255)
@@ -351,6 +351,9 @@
for(pos=xy_list; pos; pos=pos->next)
nxpts ++;
+ if(nxpts == 0)
+ return;
+
/* +1 so we can close it for XDrawLines */
xpts = safe_malloc((nxpts + 1) * sizeof(XPoint));
@@ -418,6 +421,9 @@
for(pos=xy_list; pos; pos=pos->next)
nxpts ++;
+ if(nxpts == 0)
+ return;
+
xpts = safe_malloc(nxpts * sizeof(XPoint));
pos = xy_list;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-23 13:45:26
|
Revision: 254
http://svn.sourceforge.net/redbutton/?rev=254&view=rev
Author: skilvington
Date: 2007-03-23 06:45:24 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
DrawPolyline DynamicLineArtClass method
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
redbutton-browser/trunk/MHEGCanvas.c
redbutton-browser/trunk/MHEGCanvas.h
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-22 17:42:27 UTC (rev 253)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-23 13:45:24 UTC (rev 254)
@@ -626,10 +626,30 @@
void
DynamicLineArtClass_DrawPolyline(DynamicLineArtClass *t, DrawPolyline *params, OctetString *caller_gid)
{
+ LIST_OF(XYPosition) *xy_list = NULL;
+ LIST_TYPE(XYPosition) *xy;
+ LIST_TYPE(Point) *pt;
+
verbose("DynamicLineArtClass: %s; DrawPolyline", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_DrawPolyline not yet implemented\n");
+ for(pt=params->pointlist; pt; pt=pt->next)
+ {
+ xy = safe_malloc(sizeof(LIST_TYPE(XYPosition)));
+ xy->item.x_position = GenericInteger_getInteger(&pt->item.x, caller_gid);
+ xy->item.y_position = GenericInteger_getInteger(&pt->item.y, caller_gid);
+ LIST_APPEND(&xy_list, xy);
+ }
+
+ MHEGCanvas_drawPolyline(t->inst.canvas, xy_list,
+ t->inst.LineWidth, t->inst.LineStyle,
+ &t->inst.RefLineColour);
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+
+ LIST_FREE(&xy_list, XYPosition, safe_free);
+
return;
}
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-22 17:42:27 UTC (rev 253)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-23 13:45:24 UTC (rev 254)
@@ -390,6 +390,60 @@
}
/*
+ * draw a set of joined lines
+ * the lines are drawn width pixels wide in the given colour
+ */
+
+void
+MHEGCanvas_drawPolyline(MHEGCanvas *c, LIST_OF(XYPosition) *xy_list, int width, int style, MHEGColour *colour)
+{
+ MHEGDisplay *d = MHEGEngine_getDisplay();
+ LIST_TYPE(XYPosition) *pos;
+ unsigned int nxpts;
+ XPoint *xpts;
+ unsigned int i;
+ XGCValues gcvals;
+
+ if(width <= 0)
+ return;
+
+ if(style != LineStyle_solid)
+ error("MHEGCanvas_drawPolyline: LineStyle %d not supported (using a solid line)", style);
+
+ /* scale up if fullscreen */
+ width = (width * d->xres) / MHEG_XRES;
+
+ /* convert the XYPosition list into an array of XPoint's */
+ nxpts = 0;
+ for(pos=xy_list; pos; pos=pos->next)
+ nxpts ++;
+
+ xpts = safe_malloc(nxpts * sizeof(XPoint));
+
+ pos = xy_list;
+ for(i=0; i<nxpts; i++)
+ {
+ /* scale up if fullscreen */
+ xpts[i].x = (pos->item.x_position * d->xres) / MHEG_XRES;
+ xpts[i].y = (pos->item.y_position * d->yres) / MHEG_YRES;
+ pos = pos->next;
+ }
+
+ /* set the line width and colour */
+ gcvals.foreground = pixel_value(c->pic_format, colour);
+ gcvals.line_width = width;
+ XChangeGC(d->dpy, c->gc, GCForeground | GCLineWidth, &gcvals);
+
+ /* draw it */
+ XDrawLines(d->dpy, c->contents, c->gc, xpts, nxpts, CoordModeOrigin);
+
+ /* clean up */
+ safe_free(xpts);
+
+ return;
+}
+
+/*
* draw a rectangle
* the outline is drawn width pixels wide (ie it may stick out of the box) in line_col
* it is filled with fill_col
Modified: redbutton-browser/trunk/MHEGCanvas.h
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.h 2007-03-22 17:42:27 UTC (rev 253)
+++ redbutton-browser/trunk/MHEGCanvas.h 2007-03-23 13:45:24 UTC (rev 254)
@@ -30,6 +30,7 @@
void MHEGCanvas_drawLine(MHEGCanvas *, XYPosition *, XYPosition *, int, int, MHEGColour *);
void MHEGCanvas_drawOval(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, MHEGColour *, MHEGColour *);
void MHEGCanvas_drawPolygon(MHEGCanvas *, LIST_OF(XYPosition) *, int, int, MHEGColour *, MHEGColour *);
+void MHEGCanvas_drawPolyline(MHEGCanvas *, LIST_OF(XYPosition) *, int, int, MHEGColour *);
void MHEGCanvas_drawRectangle(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, MHEGColour *, MHEGColour *);
#endif /* __MHEGCANVAS_H__ */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-22 17:42:33
|
Revision: 253
http://svn.sourceforge.net/redbutton/?rev=253&view=rev
Author: skilvington
Date: 2007-03-22 10:42:27 -0700 (Thu, 22 Mar 2007)
Log Message:
-----------
DrawPolygon DynamicLineArtClass method
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
redbutton-browser/trunk/MHEGCanvas.c
redbutton-browser/trunk/MHEGCanvas.h
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-22 09:35:08 UTC (rev 252)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-22 17:42:27 UTC (rev 253)
@@ -486,7 +486,9 @@
return;
}
- MHEGCanvas_drawArc(t->inst.canvas, &pos, &box, start, arc, t->inst.LineWidth, t->inst.LineStyle, &t->inst.RefLineColour);
+ MHEGCanvas_drawArc(t->inst.canvas, &pos, &box, start, arc,
+ t->inst.LineWidth, t->inst.LineStyle,
+ &t->inst.RefLineColour);
/* if it is active, redraw it */
if(t->rootClass.inst.RunningStatus)
@@ -526,7 +528,8 @@
}
MHEGCanvas_drawSector(t->inst.canvas, &pos, &box, start, arc,
- t->inst.LineWidth, t->inst.LineStyle, &t->inst.RefLineColour, &t->inst.RefFillColour);
+ t->inst.LineWidth, t->inst.LineStyle,
+ &t->inst.RefLineColour, &t->inst.RefFillColour);
/* if it is active, redraw it */
if(t->rootClass.inst.RunningStatus)
@@ -548,7 +551,9 @@
p2.x_position = GenericInteger_getInteger(¶ms->x2, caller_gid);
p2.y_position = GenericInteger_getInteger(¶ms->y2, caller_gid);
- MHEGCanvas_drawLine(t->inst.canvas, &p1, &p2, t->inst.LineWidth, t->inst.LineStyle, &t->inst.RefLineColour);
+ MHEGCanvas_drawLine(t->inst.canvas, &p1, &p2,
+ t->inst.LineWidth, t->inst.LineStyle,
+ &t->inst.RefLineColour);
/* if it is active, redraw it */
if(t->rootClass.inst.RunningStatus)
@@ -591,10 +596,30 @@
void
DynamicLineArtClass_DrawPolygon(DynamicLineArtClass *t, DrawPolygon *params, OctetString *caller_gid)
{
+ LIST_OF(XYPosition) *xy_list = NULL;
+ LIST_TYPE(XYPosition) *xy;
+ LIST_TYPE(Point) *pt;
+
verbose("DynamicLineArtClass: %s; DrawPolygon", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_DrawPolygon not yet implemented\n");
+ for(pt=params->pointlist; pt; pt=pt->next)
+ {
+ xy = safe_malloc(sizeof(LIST_TYPE(XYPosition)));
+ xy->item.x_position = GenericInteger_getInteger(&pt->item.x, caller_gid);
+ xy->item.y_position = GenericInteger_getInteger(&pt->item.y, caller_gid);
+ LIST_APPEND(&xy_list, xy);
+ }
+
+ MHEGCanvas_drawPolygon(t->inst.canvas, xy_list,
+ t->inst.LineWidth, t->inst.LineStyle,
+ &t->inst.RefLineColour, &t->inst.RefFillColour);
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+
+ LIST_FREE(&xy_list, XYPosition, safe_free);
+
return;
}
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-22 09:35:08 UTC (rev 252)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-22 17:42:27 UTC (rev 253)
@@ -324,6 +324,72 @@
}
/*
+ * draw a closed polygon
+ * the outline is drawn width pixels wide (ie it may stick out of the box) in line_col
+ * it is filled with fill_col
+ * UK MHEG Profile says polygons must be convex
+ */
+
+void
+MHEGCanvas_drawPolygon(MHEGCanvas *c, LIST_OF(XYPosition) *xy_list, int width, int style, MHEGColour *line_col, MHEGColour *fill_col)
+{
+ MHEGDisplay *d = MHEGEngine_getDisplay();
+ LIST_TYPE(XYPosition) *pos;
+ unsigned int nxpts;
+ XPoint *xpts;
+ unsigned int i;
+ XGCValues gcvals;
+
+ if(style != LineStyle_solid)
+ error("MHEGCanvas_drawPolygon: LineStyle %d not supported (using a solid line)", style);
+
+ /* scale up if fullscreen */
+ width = (width * d->xres) / MHEG_XRES;
+
+ /* convert the XYPosition list into an array of XPoint's */
+ nxpts = 0;
+ for(pos=xy_list; pos; pos=pos->next)
+ nxpts ++;
+
+ /* +1 so we can close it for XDrawLines */
+ xpts = safe_malloc((nxpts + 1) * sizeof(XPoint));
+
+ pos = xy_list;
+ for(i=0; i<nxpts; i++)
+ {
+ /* scale up if fullscreen */
+ xpts[i].x = (pos->item.x_position * d->xres) / MHEG_XRES;
+ xpts[i].y = (pos->item.y_position * d->yres) / MHEG_YRES;
+ pos = pos->next;
+ }
+
+ /* fill it */
+ gcvals.foreground = pixel_value(c->pic_format, fill_col);
+ XChangeGC(d->dpy, c->gc, GCForeground, &gcvals);
+
+ XFillPolygon(d->dpy, c->contents, c->gc, xpts, nxpts, Convex, CoordModeOrigin);
+
+ /* draw the outline */
+ if(width > 0)
+ {
+ /* close the polygon */
+ xpts[nxpts].x = (xy_list->item.x_position * d->xres) / MHEG_XRES;
+ xpts[nxpts].y = (xy_list->item.y_position * d->yres) / MHEG_YRES;
+ /* set the line width and colour */
+ gcvals.foreground = pixel_value(c->pic_format, line_col);
+ gcvals.line_width = width;
+ XChangeGC(d->dpy, c->gc, GCForeground | GCLineWidth, &gcvals);
+ /* draw it */
+ XDrawLines(d->dpy, c->contents, c->gc, xpts, nxpts + 1, CoordModeOrigin);
+ }
+
+ /* clean up */
+ safe_free(xpts);
+
+ return;
+}
+
+/*
* draw a rectangle
* the outline is drawn width pixels wide (ie it may stick out of the box) in line_col
* it is filled with fill_col
Modified: redbutton-browser/trunk/MHEGCanvas.h
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.h 2007-03-22 09:35:08 UTC (rev 252)
+++ redbutton-browser/trunk/MHEGCanvas.h 2007-03-22 17:42:27 UTC (rev 253)
@@ -29,6 +29,7 @@
void MHEGCanvas_drawSector(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, int, int, MHEGColour *, MHEGColour *);
void MHEGCanvas_drawLine(MHEGCanvas *, XYPosition *, XYPosition *, int, int, MHEGColour *);
void MHEGCanvas_drawOval(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, MHEGColour *, MHEGColour *);
+void MHEGCanvas_drawPolygon(MHEGCanvas *, LIST_OF(XYPosition) *, int, int, MHEGColour *, MHEGColour *);
void MHEGCanvas_drawRectangle(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, MHEGColour *, MHEGColour *);
#endif /* __MHEGCANVAS_H__ */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-22 09:35:11
|
Revision: 252
http://svn.sourceforge.net/redbutton/?rev=252&view=rev
Author: skilvington
Date: 2007-03-22 02:35:08 -0700 (Thu, 22 Mar 2007)
Log Message:
-----------
how to improve a/v performance
Modified Paths:
--------------
redbutton-browser/trunk/TODO
Modified: redbutton-browser/trunk/TODO
===================================================================
--- redbutton-browser/trunk/TODO 2007-03-20 09:34:52 UTC (rev 251)
+++ redbutton-browser/trunk/TODO 2007-03-22 09:35:08 UTC (rev 252)
@@ -1,3 +1,9 @@
+openStream:
+if "remote" backend is 127.0.0.1, open dvr device in rb-browser
+- ask rb-download to set the PID filters, it returns the dvr dev name
+- when connection is closed, rb-download clears filters
+
+
posix_fadvise() when streaming data from the backend?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-20 09:34:54
|
Revision: 251
http://svn.sourceforge.net/redbutton/?rev=251&view=rev
Author: skilvington
Date: 2007-03-20 02:34:52 -0700 (Tue, 20 Mar 2007)
Log Message:
-----------
more TODO
Modified Paths:
--------------
redbutton-browser/trunk/TODO
Modified: redbutton-browser/trunk/TODO
===================================================================
--- redbutton-browser/trunk/TODO 2007-03-19 12:08:06 UTC (rev 250)
+++ redbutton-browser/trunk/TODO 2007-03-20 09:34:52 UTC (rev 251)
@@ -1,3 +1,6 @@
+posix_fadvise() when streaming data from the backend?
+
+
aspect ratio
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-19 12:08:09
|
Revision: 250
http://svn.sourceforge.net/redbutton/?rev=250&view=rev
Author: skilvington
Date: 2007-03-19 05:08:06 -0700 (Mon, 19 Mar 2007)
Log Message:
-----------
check ellipse size is >=0 in DynamicLineArtClass
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
redbutton-browser/trunk/MHEGCanvas.c
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-16 16:57:08 UTC (rev 249)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-19 12:08:06 UTC (rev 250)
@@ -479,6 +479,12 @@
error("DynamicLineArtClass_DrawArc: invalid ArcAngle (%d)", arc);
return;
}
+ /* corrigendum puts these limits on the ellipse size */
+ if(box.x_length < 0 || box.y_length < 0)
+ {
+ error("DynamicLineArtClass_DrawArc: invalid ellipse size (%d,%d)", box.x_length, box.y_length);
+ return;
+ }
MHEGCanvas_drawArc(t->inst.canvas, &pos, &box, start, arc, t->inst.LineWidth, t->inst.LineStyle, &t->inst.RefLineColour);
@@ -512,6 +518,12 @@
error("DynamicLineArtClass_DrawSector: invalid ArcAngle (%d)", arc);
return;
}
+ /* corrigendum puts these limits on the ellipse size */
+ if(box.x_length < 0 || box.y_length < 0)
+ {
+ error("DynamicLineArtClass_DrawSector: invalid ellipse size (%d,%d)", box.x_length, box.y_length);
+ return;
+ }
MHEGCanvas_drawSector(t->inst.canvas, &pos, &box, start, arc,
t->inst.LineWidth, t->inst.LineStyle, &t->inst.RefLineColour, &t->inst.RefFillColour);
@@ -558,6 +570,13 @@
box.x_length = GenericInteger_getInteger(¶ms->ellipse_width, caller_gid);
box.y_length = GenericInteger_getInteger(¶ms->ellipse_height, caller_gid);
+ /* corrigendum puts these limits on the ellipse size */
+ if(box.x_length < 0 || box.y_length < 0)
+ {
+ error("DynamicLineArtClass_DrawOval: invalid ellipse size (%d,%d)", box.x_length, box.y_length);
+ return;
+ }
+
MHEGCanvas_drawOval(t->inst.canvas, &pos, &box,
t->inst.LineWidth, t->inst.LineStyle,
&t->inst.RefLineColour, &t->inst.RefFillColour);
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-16 16:57:08 UTC (rev 249)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-19 12:08:06 UTC (rev 250)
@@ -294,13 +294,6 @@
XGCValues gcvals;
int x, y, w, h;
- /* corrigendum puts these limits on the ellipse size */
- if(box->x_length < 0 || box->y_length < 0)
- {
- error("MHEGCanvas_drawOval: invalid box size (%d,%d)", box->x_length, box->y_length);
- return;
- }
-
if(style != LineStyle_solid)
error("MHEGCanvas_drawOval: LineStyle %d not supported (using a solid line)", style);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-16 16:57:13
|
Revision: 249
http://svn.sourceforge.net/redbutton/?rev=249&view=rev
Author: skilvington
Date: 2007-03-16 09:57:08 -0700 (Fri, 16 Mar 2007)
Log Message:
-----------
DrawArc/Sector DynamicLineArtClass methods
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
redbutton-browser/trunk/MHEGCanvas.c
redbutton-browser/trunk/MHEGCanvas.h
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-13 17:10:33 UTC (rev 248)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-16 16:57:08 UTC (rev 249)
@@ -459,20 +459,67 @@
void
DynamicLineArtClass_DrawArc(DynamicLineArtClass *t, DrawArc *params, OctetString *caller_gid)
{
+ XYPosition pos;
+ OriginalBoxSize box;
+ int start;
+ int arc;
+
verbose("DynamicLineArtClass: %s; DrawArc", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_DrawArc not yet implemented\n");
+ pos.x_position = GenericInteger_getInteger(¶ms->x, caller_gid);
+ pos.y_position = GenericInteger_getInteger(¶ms->y, caller_gid);
+ box.x_length = GenericInteger_getInteger(¶ms->ellipse_width, caller_gid);
+ box.y_length = GenericInteger_getInteger(¶ms->ellipse_height, caller_gid);
+ start = GenericInteger_getInteger(¶ms->start_angle, caller_gid);
+ arc = GenericInteger_getInteger(¶ms->arc_angle, caller_gid);
+
+ /* ISO spec says ArcAngle should not be 0 */
+ if(arc == 0)
+ {
+ error("DynamicLineArtClass_DrawArc: invalid ArcAngle (%d)", arc);
+ return;
+ }
+
+ MHEGCanvas_drawArc(t->inst.canvas, &pos, &box, start, arc, t->inst.LineWidth, t->inst.LineStyle, &t->inst.RefLineColour);
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+
return;
}
void
DynamicLineArtClass_DrawSector(DynamicLineArtClass *t, DrawSector *params, OctetString *caller_gid)
{
+ XYPosition pos;
+ OriginalBoxSize box;
+ int start;
+ int arc;
+
verbose("DynamicLineArtClass: %s; DrawSector", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_DrawSector not yet implemented\n");
+ pos.x_position = GenericInteger_getInteger(¶ms->x, caller_gid);
+ pos.y_position = GenericInteger_getInteger(¶ms->y, caller_gid);
+ box.x_length = GenericInteger_getInteger(¶ms->ellipse_width, caller_gid);
+ box.y_length = GenericInteger_getInteger(¶ms->ellipse_height, caller_gid);
+ start = GenericInteger_getInteger(¶ms->start_angle, caller_gid);
+ arc = GenericInteger_getInteger(¶ms->arc_angle, caller_gid);
+
+ /* ISO spec says ArcAngle should not be 0 */
+ if(arc == 0)
+ {
+ error("DynamicLineArtClass_DrawSector: invalid ArcAngle (%d)", arc);
+ return;
+ }
+
+ MHEGCanvas_drawSector(t->inst.canvas, &pos, &box, start, arc,
+ t->inst.LineWidth, t->inst.LineStyle, &t->inst.RefLineColour, &t->inst.RefFillColour);
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+
return;
}
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-13 17:10:33 UTC (rev 248)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-16 16:57:08 UTC (rev 249)
@@ -2,6 +2,7 @@
* MHEGCanvas.c
*/
+#include <math.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
@@ -140,6 +141,113 @@
}
/*
+ * draw an arc enclosed by the given box, starting at start (0 = 3 o' clock) for arc degrees anticlockwise
+ * start and arc should be in degrees * 64
+ * the arc is drawn width pixels wide (ie it may stick out of the box) in the given colour
+ */
+
+void
+MHEGCanvas_drawArc(MHEGCanvas *c, XYPosition *pos, OriginalBoxSize *box, int start, int arc, int width, int style, MHEGColour *colour)
+{
+ MHEGDisplay *d = MHEGEngine_getDisplay();
+ XGCValues gcvals;
+ int x, y, w, h;
+
+ if(width <= 0)
+ return;
+
+ if(style != LineStyle_solid)
+ error("MHEGCanvas_drawArc: LineStyle %d not supported (using a solid line)", style);
+
+ /* scale up if fullscreen */
+ x = (pos->x_position * d->xres) / MHEG_XRES;
+ y = (pos->y_position * d->yres) / MHEG_YRES;
+ w = (box->x_length * d->xres) / MHEG_XRES;
+ h = (box->y_length * d->yres) / MHEG_YRES;
+ width = (width * d->xres) / MHEG_XRES;
+
+ /* set up the GC values */
+ gcvals.foreground = pixel_value(c->pic_format, colour);
+ gcvals.line_width = width;
+ XChangeGC(d->dpy, c->gc, GCForeground | GCLineWidth, &gcvals);
+
+ /* luckily X uses the same params as MHEG */
+ XDrawArc(d->dpy, c->contents, c->gc, x, y, w, h, start, arc);
+
+ return;
+}
+
+/*
+ * draw a pie chart sector enclosed by the given box, starting at start (0 = 3 o' clock) for arc degrees anticlockwise
+ * start and arc should be in degrees * 64
+ * the sector is drawn in fill_col
+ * the sector is outlined with a line width pixels wide (ie it may stick out of the box) in line_col
+ */
+
+void
+MHEGCanvas_drawSector(MHEGCanvas *c,
+ XYPosition *pos, OriginalBoxSize *box, int start, int arc,
+ int width, int style, MHEGColour *line_col, MHEGColour *fill_col)
+{
+ MHEGDisplay *d = MHEGEngine_getDisplay();
+ XGCValues gcvals;
+ int x, y, w, h;
+ int cx, cy;
+ double start_rads, end_rads;
+ int edgex, edgey;
+
+ if(style != LineStyle_solid)
+ error("MHEGCanvas_drawSector: LineStyle %d not supported (using a solid line)", style);
+
+ /* scale up if fullscreen */
+ x = (pos->x_position * d->xres) / MHEG_XRES;
+ y = (pos->y_position * d->yres) / MHEG_YRES;
+ w = (box->x_length * d->xres) / MHEG_XRES;
+ h = (box->y_length * d->yres) / MHEG_YRES;
+ width = (width * d->xres) / MHEG_XRES;
+
+ /* fill it */
+ gcvals.foreground = pixel_value(c->pic_format, fill_col);
+ gcvals.arc_mode = ArcPieSlice;
+ XChangeGC(d->dpy, c->gc, GCForeground | GCArcMode, &gcvals);
+
+ /* luckily X uses the same params as MHEG */
+ XFillArc(d->dpy, c->contents, c->gc, x, y, w, h, start, arc);
+
+ /* draw the outline */
+ if(width <= 0)
+ return;
+
+ gcvals.foreground = pixel_value(c->pic_format, line_col);
+ gcvals.line_width = width;
+ XChangeGC(d->dpy, c->gc, GCForeground | GCLineWidth, &gcvals);
+
+ /* easy bit */
+ XDrawArc(d->dpy, c->contents, c->gc, x, y, w, h, start, arc);
+
+ /* lines from the centre to the start and end of the arc */
+ cx = x + (w / 2);
+ cy = y + (h / 2);
+ start_rads = ((double) start / 64.0) * M_PI / 180.0;
+ edgex = cos(start_rads) * (w / 2);
+ edgey = sin(start_rads) * (h / 2);
+ /* cy - edgey, because Y increases as we go down the screen */
+ XDrawLine(d->dpy, c->contents, c->gc, cx, cy, cx + edgex, cy - edgey);
+
+ end_rads = ((double) (start + arc) / 64.0) * M_PI / 180.0;
+ edgex = cos(end_rads) * (w / 2);
+ edgey = sin(end_rads) * (h / 2);
+ XDrawLine(d->dpy, c->contents, c->gc, cx, cy, cx + edgex, cy - edgey);
+
+/* TODO */
+/* make proper joins between the arc and the 2 lines */
+/* ends of the arc are on a tangent to the ellipse */
+/* can't join to a length 0 line because it has no direction, but a 1 pixel long line may be too long */
+
+ return;
+}
+
+/*
* draw a line between p1 and p2
*/
@@ -210,6 +318,9 @@
XFillArc(d->dpy, c->contents, c->gc, x, y, w, h, 0, 360 * 64);
/* draw the outline */
+ if(width <= 0)
+ return;
+
gcvals.foreground = pixel_value(c->pic_format, line_col);
gcvals.line_width = width;
XChangeGC(d->dpy, c->gc, GCForeground | GCLineWidth, &gcvals);
@@ -249,6 +360,9 @@
XFillRectangle(d->dpy, c->contents, c->gc, x, y, w, h);
/* draw the outline */
+ if(width <= 0)
+ return;
+
gcvals.foreground = pixel_value(c->pic_format, line_col);
gcvals.line_width = width;
XChangeGC(d->dpy, c->gc, GCForeground | GCLineWidth, &gcvals);
Modified: redbutton-browser/trunk/MHEGCanvas.h
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.h 2007-03-13 17:10:33 UTC (rev 248)
+++ redbutton-browser/trunk/MHEGCanvas.h 2007-03-16 16:57:08 UTC (rev 249)
@@ -25,6 +25,8 @@
void MHEGCanvas_setBorder(MHEGCanvas *, int, int, MHEGColour *);
void MHEGCanvas_clear(MHEGCanvas *, MHEGColour *);
+void MHEGCanvas_drawArc(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, int, int, MHEGColour *);
+void MHEGCanvas_drawSector(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, int, int, MHEGColour *, MHEGColour *);
void MHEGCanvas_drawLine(MHEGCanvas *, XYPosition *, XYPosition *, int, int, MHEGColour *);
void MHEGCanvas_drawOval(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, MHEGColour *, MHEGColour *);
void MHEGCanvas_drawRectangle(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, MHEGColour *, MHEGColour *);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-13 17:10:39
|
Revision: 248
http://svn.sourceforge.net/redbutton/?rev=248&view=rev
Author: skilvington
Date: 2007-03-13 10:10:33 -0700 (Tue, 13 Mar 2007)
Log Message:
-----------
DrawLine/Oval/Rectangle DynamicLineArtClass methods
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
redbutton-browser/trunk/MHEGCanvas.c
redbutton-browser/trunk/MHEGCanvas.h
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-13 14:27:19 UTC (rev 247)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-13 17:10:33 UTC (rev 248)
@@ -479,20 +479,46 @@
void
DynamicLineArtClass_DrawLine(DynamicLineArtClass *t, DrawLine *params, OctetString *caller_gid)
{
+ XYPosition p1;
+ XYPosition p2;
+
verbose("DynamicLineArtClass: %s; DrawLine", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_DrawLine not yet implemented\n");
+ p1.x_position = GenericInteger_getInteger(¶ms->x1, caller_gid);
+ p1.y_position = GenericInteger_getInteger(¶ms->y1, caller_gid);
+ p2.x_position = GenericInteger_getInteger(¶ms->x2, caller_gid);
+ p2.y_position = GenericInteger_getInteger(¶ms->y2, caller_gid);
+
+ MHEGCanvas_drawLine(t->inst.canvas, &p1, &p2, t->inst.LineWidth, t->inst.LineStyle, &t->inst.RefLineColour);
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+
return;
}
void
DynamicLineArtClass_DrawOval(DynamicLineArtClass *t, DrawOval *params, OctetString *caller_gid)
{
+ XYPosition pos;
+ OriginalBoxSize box;
+
verbose("DynamicLineArtClass: %s; DrawOval", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_DrawOval not yet implemented\n");
+ pos.x_position = GenericInteger_getInteger(¶ms->x, caller_gid);
+ pos.y_position = GenericInteger_getInteger(¶ms->y, caller_gid);
+ box.x_length = GenericInteger_getInteger(¶ms->ellipse_width, caller_gid);
+ box.y_length = GenericInteger_getInteger(¶ms->ellipse_height, caller_gid);
+
+ MHEGCanvas_drawOval(t->inst.canvas, &pos, &box,
+ t->inst.LineWidth, t->inst.LineStyle,
+ &t->inst.RefLineColour, &t->inst.RefFillColour);
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+
return;
}
@@ -519,10 +545,24 @@
void
DynamicLineArtClass_DrawRectangle(DynamicLineArtClass *t, DrawRectangle *params, OctetString *caller_gid)
{
+ XYPosition pos;
+ OriginalBoxSize box;
+
verbose("DynamicLineArtClass: %s; DrawRectangle", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_DrawRectangle not yet implemented\n");
+ pos.x_position = GenericInteger_getInteger(¶ms->x1, caller_gid);
+ pos.y_position = GenericInteger_getInteger(¶ms->y1, caller_gid);
+ box.x_length = GenericInteger_getInteger(¶ms->x2, caller_gid) - pos.x_position;
+ box.y_length = GenericInteger_getInteger(¶ms->y2, caller_gid) - pos.y_position;
+
+ MHEGCanvas_drawRectangle(t->inst.canvas, &pos, &box,
+ t->inst.LineWidth, t->inst.LineStyle,
+ &t->inst.RefLineColour, &t->inst.RefFillColour);
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+
return;
}
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-13 14:27:19 UTC (rev 247)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-13 17:10:33 UTC (rev 248)
@@ -110,7 +110,12 @@
* drawing routine notes:
* if border width is W, then coord {W,W} is the first pixel that will not be hidden by the border
* all coords will be scaled up by these drawing routines if we are using full screen mode
- * UK MHEG Profile says we can treat ALL line styles as solid
+ * the line width will also be scaled up in full screen mode (based on the resolution in the X direction)
+ * line style should be one of:
+ * LineStyle_solid
+ * LineStyle_dashed
+ * LineStyle_dotted
+ * but, the UK MHEG Profile says we can treat ALL line styles as solid
* UK MHEG Profile says no alpha blending is done within the DynamicLineArtClass canvas
* ie all pixel values are put directly onto the canvas, replacing what was there before
*/
@@ -135,6 +140,125 @@
}
/*
+ * draw a line between p1 and p2
+ */
+
+void
+MHEGCanvas_drawLine(MHEGCanvas *c, XYPosition *p1, XYPosition *p2, int width, int style, MHEGColour *colour)
+{
+ MHEGDisplay *d = MHEGEngine_getDisplay();
+ XGCValues gcvals;
+ int x1, y1, x2, y2;
+
+ if(width <= 0)
+ return;
+
+ if(style != LineStyle_solid)
+ error("MHEGCanvas_drawLine: LineStyle %d not supported (using a solid line)", style);
+
+ /* scale up if fullscreen */
+ x1 = (p1->x_position * d->xres) / MHEG_XRES;
+ y1 = (p1->y_position * d->yres) / MHEG_YRES;
+ x2 = (p2->x_position * d->xres) / MHEG_XRES;
+ y2 = (p2->y_position * d->yres) / MHEG_YRES;
+ width = (width * d->xres) / MHEG_XRES;
+
+ /* set up the GC values */
+ gcvals.foreground = pixel_value(c->pic_format, colour);
+ gcvals.line_width = width;
+ XChangeGC(d->dpy, c->gc, GCForeground | GCLineWidth, &gcvals);
+
+ XDrawLine(d->dpy, c->contents, c->gc, x1, y1, x2, y2);
+
+ return;
+}
+
+/*
+ * draw an oval enclosed by the given box
+ * the outline is drawn width pixels wide (ie it may stick out of the box) in line_col
+ * the oval is filled with fill_col
+ */
+
+void
+MHEGCanvas_drawOval(MHEGCanvas *c, XYPosition *pos, OriginalBoxSize *box, int width, int style, MHEGColour *line_col, MHEGColour *fill_col)
+{
+ MHEGDisplay *d = MHEGEngine_getDisplay();
+ XGCValues gcvals;
+ int x, y, w, h;
+
+ /* corrigendum puts these limits on the ellipse size */
+ if(box->x_length < 0 || box->y_length < 0)
+ {
+ error("MHEGCanvas_drawOval: invalid box size (%d,%d)", box->x_length, box->y_length);
+ return;
+ }
+
+ if(style != LineStyle_solid)
+ error("MHEGCanvas_drawOval: LineStyle %d not supported (using a solid line)", style);
+
+ /* scale up if fullscreen */
+ x = (pos->x_position * d->xres) / MHEG_XRES;
+ y = (pos->y_position * d->yres) / MHEG_YRES;
+ w = (box->x_length * d->xres) / MHEG_XRES;
+ h = (box->y_length * d->yres) / MHEG_YRES;
+ width = (width * d->xres) / MHEG_XRES;
+
+ /* fill it */
+ gcvals.foreground = pixel_value(c->pic_format, fill_col);
+ XChangeGC(d->dpy, c->gc, GCForeground, &gcvals);
+
+ XFillArc(d->dpy, c->contents, c->gc, x, y, w, h, 0, 360 * 64);
+
+ /* draw the outline */
+ gcvals.foreground = pixel_value(c->pic_format, line_col);
+ gcvals.line_width = width;
+ XChangeGC(d->dpy, c->gc, GCForeground | GCLineWidth, &gcvals);
+
+ XDrawArc(d->dpy, c->contents, c->gc, x, y, w, h, 0, 360 * 64);
+
+ return;
+}
+
+/*
+ * draw a rectangle
+ * the outline is drawn width pixels wide (ie it may stick out of the box) in line_col
+ * it is filled with fill_col
+ */
+
+void
+MHEGCanvas_drawRectangle(MHEGCanvas *c, XYPosition *pos, OriginalBoxSize *box, int width, int style, MHEGColour *line_col, MHEGColour *fill_col)
+{
+ MHEGDisplay *d = MHEGEngine_getDisplay();
+ XGCValues gcvals;
+ int x, y, w, h;
+
+ if(style != LineStyle_solid)
+ error("MHEGCanvas_drawRectangle: LineStyle %d not supported (using a solid line)", style);
+
+ /* scale up if fullscreen */
+ x = (pos->x_position * d->xres) / MHEG_XRES;
+ y = (pos->y_position * d->yres) / MHEG_YRES;
+ w = (box->x_length * d->xres) / MHEG_XRES;
+ h = (box->y_length * d->yres) / MHEG_YRES;
+ width = (width * d->xres) / MHEG_XRES;
+
+ /* fill it */
+ gcvals.foreground = pixel_value(c->pic_format, fill_col);
+ XChangeGC(d->dpy, c->gc, GCForeground, &gcvals);
+
+ XFillRectangle(d->dpy, c->contents, c->gc, x, y, w, h);
+
+ /* draw the outline */
+ gcvals.foreground = pixel_value(c->pic_format, line_col);
+ gcvals.line_width = width;
+ XChangeGC(d->dpy, c->gc, GCForeground | GCLineWidth, &gcvals);
+
+ XDrawRectangle(d->dpy, c->contents, c->gc, x, y, w, h);
+
+ return;
+}
+
+/*
* convert the MHEGColour to a pixel value
*/
Modified: redbutton-browser/trunk/MHEGCanvas.h
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.h 2007-03-13 14:27:19 UTC (rev 247)
+++ redbutton-browser/trunk/MHEGCanvas.h 2007-03-13 17:10:33 UTC (rev 248)
@@ -25,6 +25,9 @@
void MHEGCanvas_setBorder(MHEGCanvas *, int, int, MHEGColour *);
void MHEGCanvas_clear(MHEGCanvas *, MHEGColour *);
+void MHEGCanvas_drawLine(MHEGCanvas *, XYPosition *, XYPosition *, int, int, MHEGColour *);
+void MHEGCanvas_drawOval(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, MHEGColour *, MHEGColour *);
+void MHEGCanvas_drawRectangle(MHEGCanvas *, XYPosition *, OriginalBoxSize *, int, int, MHEGColour *, MHEGColour *);
#endif /* __MHEGCANVAS_H__ */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-13 14:27:26
|
Revision: 247
http://svn.sourceforge.net/redbutton/?rev=247&view=rev
Author: skilvington
Date: 2007-03-13 07:27:19 -0700 (Tue, 13 Mar 2007)
Log Message:
-----------
MHEGCanvas_clear
Modified Paths:
--------------
redbutton-browser/trunk/MHEGCanvas.c
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-13 14:21:25 UTC (rev 246)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-13 14:27:19 UTC (rev 247)
@@ -122,9 +122,15 @@
void
MHEGCanvas_clear(MHEGCanvas *c, MHEGColour *colour)
{
-/* TODO */
-printf("TODO: MHEGCanvas_clear: RGBT=%02x%02x%02x%02x\n", colour->r, colour->g, colour->b, colour->t);
+ MHEGDisplay *d = MHEGEngine_getDisplay();
+ XGCValues gcvals;
+ gcvals.foreground = pixel_value(c->pic_format, colour);
+ XChangeGC(d->dpy, c->gc, GCForeground, &gcvals);
+
+ /* width/height are already scaled as needed */
+ XFillRectangle(d->dpy, c->contents, c->gc, c->border, c->border, c->width - (2 * c->border), c->height - (2 * c->border));
+
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-13 14:21:27
|
Revision: 246
http://svn.sourceforge.net/redbutton/?rev=246&view=rev
Author: skilvington
Date: 2007-03-13 07:21:25 -0700 (Tue, 13 Mar 2007)
Log Message:
-----------
get the border width right
Modified Paths:
--------------
redbutton-browser/trunk/MHEGCanvas.c
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-13 14:06:18 UTC (rev 245)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-13 14:21:25 UTC (rev 246)
@@ -88,13 +88,13 @@
gcvals.foreground = pixel_value(c->pic_format, colour);
XChangeGC(d->dpy, c->gc, GCForeground, &gcvals);
/* top */
- XFillRectangle(d->dpy, c->contents, c->gc, 0, 0, c->width, c->border - 1);
+ XFillRectangle(d->dpy, c->contents, c->gc, 0, 0, c->width, c->border);
/* bottom */
- XFillRectangle(d->dpy, c->contents, c->gc, 0, (c->height - c->border) - 1, c->width, c->border - 1);
+ XFillRectangle(d->dpy, c->contents, c->gc, 0, c->height - c->border, c->width, c->border);
/* left */
- XFillRectangle(d->dpy, c->contents, c->gc, 0, 0, c->border - 1, c->height);
+ XFillRectangle(d->dpy, c->contents, c->gc, 0, 0, c->border, c->height);
/* right */
- XFillRectangle(d->dpy, c->contents, c->gc, (c->width - c->border) - 1, 0, c->border - 1, c->height);
+ XFillRectangle(d->dpy, c->contents, c->gc, c->width - c->border, 0, c->border, c->height);
/* set a clip mask, so no futher drawing will change the border */
clip_rect.x = c->border;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-13 14:06:29
|
Revision: 245
http://svn.sourceforge.net/redbutton/?rev=245&view=rev
Author: skilvington
Date: 2007-03-13 07:06:18 -0700 (Tue, 13 Mar 2007)
Log Message:
-----------
draw MHEGCanvas objects
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
redbutton-browser/trunk/MHEGDisplay.c
redbutton-browser/trunk/MHEGDisplay.h
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-13 12:22:39 UTC (rev 244)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-13 14:06:18 UTC (rev 245)
@@ -546,6 +546,7 @@
{
XYPosition ins_pos;
OriginalBoxSize ins_box;
+ XYPosition src;
verbose("DynamicLineArtClass: %s; render", ExternalReference_name(&t->rootClass.inst.ref));
@@ -554,9 +555,12 @@
MHEGDisplay_setClipRectangle(d, &ins_pos, &ins_box);
-/* TODO */
-printf("TODO: DynamicLineArtClass_render\n");
+ /* work out where the intersection starts on the canvas */
+ src.x_position = ins_pos.x_position - t->inst.Position.x_position;
+ src.y_position = ins_pos.y_position - t->inst.Position.y_position;
+ MHEGDisplay_drawCanvas(d, &src, &ins_box, t->inst.canvas, &ins_pos);
+
MHEGDisplay_unsetClipRectangle(d);
return;
Modified: redbutton-browser/trunk/MHEGDisplay.c
===================================================================
--- redbutton-browser/trunk/MHEGDisplay.c 2007-03-13 12:22:39 UTC (rev 244)
+++ redbutton-browser/trunk/MHEGDisplay.c 2007-03-13 14:06:18 UTC (rev 245)
@@ -591,7 +591,34 @@
XRenderComposite(d->dpy, PictOpOver, bitmap->image_pic, None, d->next_overlay_pic,
src_x, src_y, src_x, src_y, dst_x, dst_y, w, h);
+ return;
+}
+/*
+ * coords should be in the range 0-MHEG_XRES, 0-MHEG_YRES
+ */
+
+void
+MHEGDisplay_drawCanvas(MHEGDisplay *d, XYPosition *src, OriginalBoxSize *box, MHEGCanvas *canvas, XYPosition *dst)
+{
+ int src_x, src_y;
+ int dst_x, dst_y;
+ unsigned int w, h;
+
+ /*
+ * scale up if fullscreen
+ * the canvas image itself is scaled when it is created
+ */
+ src_x = (src->x_position * d->xres) / MHEG_XRES;
+ src_y = (src->y_position * d->yres) / MHEG_YRES;
+ w = (box->x_length * d->xres) / MHEG_XRES;
+ h = (box->y_length * d->yres) / MHEG_YRES;
+ dst_x = (dst->x_position * d->xres) / MHEG_XRES;
+ dst_y = (dst->y_position * d->yres) / MHEG_YRES;
+
+ XRenderComposite(d->dpy, PictOpOver, canvas->contents_pic, None, d->next_overlay_pic,
+ src_x, src_y, src_x, src_y, dst_x, dst_y, w, h);
+
return;
}
Modified: redbutton-browser/trunk/MHEGDisplay.h
===================================================================
--- redbutton-browser/trunk/MHEGDisplay.h 2007-03-13 12:22:39 UTC (rev 244)
+++ redbutton-browser/trunk/MHEGDisplay.h 2007-03-13 14:06:18 UTC (rev 245)
@@ -72,6 +72,7 @@
void MHEGDisplay_fillTransparentRectangle(MHEGDisplay *, XYPosition *, OriginalBoxSize *);
void MHEGDisplay_fillRectangle(MHEGDisplay *, XYPosition *, OriginalBoxSize *, MHEGColour *);
void MHEGDisplay_drawBitmap(MHEGDisplay *, XYPosition *, OriginalBoxSize *, MHEGBitmap *, XYPosition *);
+void MHEGDisplay_drawCanvas(MHEGDisplay *, XYPosition *, OriginalBoxSize *, MHEGCanvas *, XYPosition *);
void MHEGDisplay_drawTextElement(MHEGDisplay *, XYPosition *, MHEGFont *, MHEGTextElement *, bool);
void MHEGDisplay_useOverlay(MHEGDisplay *);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-13 12:22:43
|
Revision: 244
http://svn.sourceforge.net/redbutton/?rev=244&view=rev
Author: skilvington
Date: 2007-03-13 05:22:39 -0700 (Tue, 13 Mar 2007)
Log Message:
-----------
create, delete and define borders for MHEGCanvas
Modified Paths:
--------------
redbutton-browser/trunk/MHEGCanvas.c
redbutton-browser/trunk/MHEGCanvas.h
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-12 17:08:27 UTC (rev 243)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-13 12:22:39 UTC (rev 244)
@@ -2,24 +2,57 @@
* MHEGCanvas.c
*/
+#include <X11/Xlib.h>
+#include <X11/extensions/Xrender.h>
+
#include "ISO13522-MHEG-5.h"
#include "MHEGCanvas.h"
+#include "MHEGEngine.h"
#include "utils.h"
+/* internal functions */
+static unsigned long pixel_value(XRenderPictFormat *, MHEGColour *);
+
MHEGCanvas *
new_MHEGCanvas(unsigned int width, unsigned int height)
{
MHEGCanvas *c = safe_mallocz(sizeof(MHEGCanvas));
+ MHEGDisplay *d = MHEGEngine_getDisplay();
-/* TODO */
-printf("TODO: new_MHEGCanvas(%u, %u)\n", width, height);
+ /* scale width/height if fullscreen */
+ c->width = (width * d->xres) / MHEG_XRES;
+ c->height = (height * d->yres) / MHEG_YRES;
+ /* no border set yet */
+ c->border = 0;
+
+ /* we want a 32-bit RGBA pixel format */
+ c->pic_format = XRenderFindStandardFormat(d->dpy, PictStandardARGB32);
+
+ /* create a Pixmap to draw on */
+ c->contents = XCreatePixmap(d->dpy, d->win, c->width, c->height, 32);
+ /* associate a Picture with it */
+ c->contents_pic = XRenderCreatePicture(d->dpy, c->contents, c->pic_format, 0, NULL);
+
+ /* and a Graphics Context */
+ c->gc = XCreateGC(d->dpy, c->contents, 0, NULL);
+
return c;
}
void
free_MHEGCanvas(MHEGCanvas *c)
{
+ MHEGDisplay *d = MHEGEngine_getDisplay();
+
+ /* assert */
+ if(c == NULL)
+ fatal("free_MHEGCanvas: passed a NULL canvas");
+
+ XRenderFreePicture(d->dpy, c->contents_pic);
+ XFreePixmap(d->dpy, c->contents);
+ XFreeGC(d->dpy, c->gc);
+
safe_free(c);
return;
@@ -27,7 +60,7 @@
/*
* set a border, no drawing will be done in the border (apart from the border itself)
- * width is in pixels
+ * width is in pixels (and will be scaled up by this routine in full screen mode)
* style should be one of:
* LineStyle_solid
* LineStyle_dashed
@@ -38,23 +71,47 @@
void
MHEGCanvas_setBorder(MHEGCanvas *c, int width, int style, MHEGColour *colour)
{
+ MHEGDisplay *d = MHEGEngine_getDisplay();
+ XGCValues gcvals;
+ XRectangle clip_rect;
+
if(width <= 0)
return;
if(style != LineStyle_solid)
error("MHEGCanvas_setBorder: LineStyle %d not supported (using a solid line)", style);
-/* TODO */
-printf("TODO: MHEGCanvas_setBorder: width=%d style=%d RGBT=%02x%02x%02x%02x\n", width, style, colour->r, colour->g, colour->b, colour->t);
+ /* scale width if fullscreen */
+ c->border = (width * d->xres) / MHEG_XRES;
+ /* draw the border */
+ gcvals.foreground = pixel_value(c->pic_format, colour);
+ XChangeGC(d->dpy, c->gc, GCForeground, &gcvals);
+ /* top */
+ XFillRectangle(d->dpy, c->contents, c->gc, 0, 0, c->width, c->border - 1);
+ /* bottom */
+ XFillRectangle(d->dpy, c->contents, c->gc, 0, (c->height - c->border) - 1, c->width, c->border - 1);
+ /* left */
+ XFillRectangle(d->dpy, c->contents, c->gc, 0, 0, c->border - 1, c->height);
+ /* right */
+ XFillRectangle(d->dpy, c->contents, c->gc, (c->width - c->border) - 1, 0, c->border - 1, c->height);
+
+ /* set a clip mask, so no futher drawing will change the border */
+ clip_rect.x = c->border;
+ clip_rect.y = c->border;
+ clip_rect.width = c->width - (2 * c->border);
+ clip_rect.height = c->height - (2 * c->border);
+ XSetClipRectangles(d->dpy, c->gc, 0, 0, &clip_rect, 1, Unsorted);
+
return;
}
/*
* drawing routine notes:
* if border width is W, then coord {W,W} is the first pixel that will not be hidden by the border
+ * all coords will be scaled up by these drawing routines if we are using full screen mode
* UK MHEG Profile says we can treat ALL line styles as solid
- * UK MHEG Profile says no alpha blending is done within the DynamicLineArt canvas
+ * UK MHEG Profile says no alpha blending is done within the DynamicLineArtClass canvas
* ie all pixel values are put directly onto the canvas, replacing what was there before
*/
@@ -71,3 +128,22 @@
return;
}
+/*
+ * convert the MHEGColour to a pixel value
+ */
+
+static unsigned long
+pixel_value(XRenderPictFormat *format, MHEGColour *colour)
+{
+ unsigned long pixel;
+
+ /* MHEGColour and PictStandardARGB32 both have 8-bits per RGBA component */
+ pixel = colour->r << format->direct.red;
+ pixel |= colour->g << format->direct.green;
+ pixel |= colour->b << format->direct.blue;
+ /* MHEGColour uses transparency, XRender uses opacity */
+ pixel |= (255 - colour->t) << format->direct.alpha;
+
+ return pixel;
+}
+
Modified: redbutton-browser/trunk/MHEGCanvas.h
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.h 2007-03-12 17:08:27 UTC (rev 243)
+++ redbutton-browser/trunk/MHEGCanvas.h 2007-03-13 12:22:39 UTC (rev 244)
@@ -10,9 +10,13 @@
typedef struct
{
- Pixmap contents; /* current image */
- Picture contents_pic; /* XRender wrapper */
- GC gc; /* contains the clip mask for the border */
+ unsigned int width; /* in pixels, will be the scaled up value in fullscreen mode */
+ unsigned int height; /* in pixels, will be the scaled up value in fullscreen mode */
+ unsigned int border; /* border width in pixels (the scaled value in fullscreen mode) */
+ Pixmap contents; /* current image */
+ Picture contents_pic; /* XRender wrapper */
+ XRenderPictFormat *pic_format; /* pixel format */
+ GC gc; /* contains the clip mask for the border */
} MHEGCanvas;
MHEGCanvas *new_MHEGCanvas(unsigned int, unsigned int);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-12 17:08:36
|
Revision: 243
http://svn.sourceforge.net/redbutton/?rev=243&view=rev
Author: skilvington
Date: 2007-03-12 10:08:27 -0700 (Mon, 12 Mar 2007)
Log Message:
-----------
the easy DynamicLineArtClass methods
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
redbutton-browser/trunk/MHEGCanvas.c
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-12 12:21:15 UTC (rev 242)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-12 17:08:27 UTC (rev 243)
@@ -205,11 +205,19 @@
t->inst.BoxSize.x_length = GenericInteger_getInteger(¶ms->x_new_box_size, caller_gid);
t->inst.BoxSize.y_length = GenericInteger_getInteger(¶ms->y_new_box_size, caller_gid);
-/* TODO */
-/* clear to OriginalRefFillColour */
-/* dont forget to update the border */
-printf("TODO: DynamicLineArtClass_SetBoxSize clear to OriginalRefFillColour\n");
+ /* spec says we should fill the drawing area with OriginalRefFillColour */
+ /* delete the old drawing area and create a new one at the new size */
+ free_MHEGCanvas(t->inst.canvas);
+ t->inst.canvas = new_MHEGCanvas(t->inst.BoxSize.x_length, t->inst.BoxSize.y_length);
+
+ /* default value for BorderedBoundingBox is true */
+ if(!t->have_bordered_bounding_box || t->bordered_bounding_box)
+ MHEGCanvas_setBorder(t->inst.canvas, t->original_line_width, t->original_line_style, &t->inst.OriginalRefLineColour);
+
+ /* now we have set the border, clear the drawing area */
+ MHEGCanvas_clear(t->inst.canvas, &t->inst.OriginalRefFillColour);
+
/* if it is active, redraw it */
if(t->rootClass.inst.RunningStatus)
{
@@ -345,8 +353,8 @@
{
verbose("DynamicLineArtClass: %s; SetLineWidth", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_SetLineWidth not yet implemented\n");
+ t->inst.LineWidth = GenericInteger_getInteger(¶ms->new_line_width, caller_gid);
+
return;
}
@@ -355,8 +363,8 @@
{
verbose("DynamicLineArtClass: %s; SetLineStyle", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_SetLineStyle not yet implemented\n");
+ t->inst.LineStyle = GenericInteger_getInteger(¶ms->new_line_style, caller_gid);
+
return;
}
@@ -365,8 +373,8 @@
{
verbose("DynamicLineArtClass: %s; SetLineColour", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_SetLineColour not yet implemented\n");
+ MHEGColour_fromNewColour(&t->inst.RefLineColour, ¶ms->new_line_colour, caller_gid);
+
return;
}
@@ -375,28 +383,56 @@
{
verbose("DynamicLineArtClass: %s; SetFillColour", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_SetFillColour not yet implemented\n");
+ /* if no colour is given, use transparent */
+ if(params->have_new_fill_colour)
+ MHEGColour_fromNewColour(&t->inst.RefFillColour, ¶ms->new_fill_colour, caller_gid);
+ else
+ MHEGColour_transparent(&t->inst.RefFillColour);
+
return;
}
void
DynamicLineArtClass_GetLineWidth(DynamicLineArtClass *t, GetLineWidth *params, OctetString *caller_gid)
{
+ VariableClass *var;
+
verbose("DynamicLineArtClass: %s; GetLineWidth", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_GetLineWidth not yet implemented\n");
+ if((var = (VariableClass *) MHEGEngine_findObjectReference(¶ms->line_width_var, caller_gid)) == NULL)
+ return;
+
+ if(var->rootClass.inst.rtti != RTTI_VariableClass
+ || VariableClass_type(var) != OriginalValue_integer)
+ {
+ error("DynamicLineArtClass: GetLineWidth: type mismatch");
+ return;
+ }
+
+ IntegerVariableClass_setInteger(var, t->inst.LineWidth);
+
return;
}
void
DynamicLineArtClass_GetLineStyle(DynamicLineArtClass *t, GetLineStyle *params, OctetString *caller_gid)
{
+ VariableClass *var;
+
verbose("DynamicLineArtClass: %s; GetLineStyle", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_GetLineStyle not yet implemented\n");
+ if((var = (VariableClass *) MHEGEngine_findObjectReference(¶ms->line_style_var, caller_gid)) == NULL)
+ return;
+
+ if(var->rootClass.inst.rtti != RTTI_VariableClass
+ || VariableClass_type(var) != OriginalValue_integer)
+ {
+ error("DynamicLineArtClass: GetLineStyle: type mismatch");
+ return;
+ }
+
+ IntegerVariableClass_setInteger(var, t->inst.LineStyle);
+
return;
}
@@ -495,8 +531,13 @@
{
verbose("DynamicLineArtClass: %s; Clear", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_Clear not yet implemented\n");
+ /* fill with OriginalRefFillColour */
+ MHEGCanvas_clear(t->inst.canvas, &t->inst.OriginalRefFillColour);
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+
return;
}
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-12 12:21:15 UTC (rev 242)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-12 17:08:27 UTC (rev 243)
@@ -21,15 +21,18 @@
free_MHEGCanvas(MHEGCanvas *c)
{
safe_free(c);
+
+ return;
}
/*
* set a border, no drawing will be done in the border (apart from the border itself)
* width is in pixels
* style should be one of:
- * original_line_style_solid
- * original_line_style_dashed
- * original_line_style_dotted
+ * LineStyle_solid
+ * LineStyle_dashed
+ * LineStyle_dotted
+ * (note: UK MHEG Profile says we can treat ALL line styles as solid)
*/
void
@@ -38,6 +41,9 @@
if(width <= 0)
return;
+ if(style != LineStyle_solid)
+ error("MHEGCanvas_setBorder: LineStyle %d not supported (using a solid line)", style);
+
/* TODO */
printf("TODO: MHEGCanvas_setBorder: width=%d style=%d RGBT=%02x%02x%02x%02x\n", width, style, colour->r, colour->g, colour->b, colour->t);
@@ -45,6 +51,14 @@
}
/*
+ * drawing routine notes:
+ * if border width is W, then coord {W,W} is the first pixel that will not be hidden by the border
+ * UK MHEG Profile says we can treat ALL line styles as solid
+ * UK MHEG Profile says no alpha blending is done within the DynamicLineArt canvas
+ * ie all pixel values are put directly onto the canvas, replacing what was there before
+ */
+
+/*
* fill the image (excluding the border) with the given colour
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-12 12:21:21
|
Revision: 242
http://svn.sourceforge.net/redbutton/?rev=242&view=rev
Author: skilvington
Date: 2007-03-12 05:21:15 -0700 (Mon, 12 Mar 2007)
Log Message:
-----------
don't be so specific about the application_type_code we accept
Modified Paths:
--------------
redbutton-download/trunk/findmheg.c
Modified: redbutton-download/trunk/findmheg.c
===================================================================
--- redbutton-download/trunk/findmheg.c 2007-03-09 16:40:47 UTC (rev 241)
+++ redbutton-download/trunk/findmheg.c 2007-03-12 12:21:15 UTC (rev 242)
@@ -77,8 +77,9 @@
} __attribute__((__packed__));
/* data_broadcast_id_descriptor values we want */
-#define DATA_BROADCAST_ID 0x0106
-#define APPLICATION_TYPE_CODE 0x0101
+#define DATA_BROADCAST_ID 0x0106
+#define UK_APPLICATION_TYPE_CODE 0x0101
+#define NZ_APPLICATION_TYPE_CODE 0x0505
static struct avstreams *find_current_avstreams(struct carousel *, int, int);
static struct avstreams *find_service_avstreams(struct carousel *, int, int, int);
@@ -189,11 +190,17 @@
{
struct data_broadcast_id_descriptor *desc;
desc = (struct data_broadcast_id_descriptor *) &pmt[offset];
- if(ntohs(desc->data_broadcast_id) == DATA_BROADCAST_ID
- && ntohs(desc->application_type_code) == APPLICATION_TYPE_CODE)
+ if(ntohs(desc->data_broadcast_id) == DATA_BROADCAST_ID)
{
desc_boot_pid = elementary_pid;
vverbose("PID=%u boot_priority_hint=%u", elementary_pid, desc->boot_priority_hint);
+ /* haven't seen the NZ MHEG Profile, but let's download the data anyway */
+ if(ntohs(desc->application_type_code) == UK_APPLICATION_TYPE_CODE)
+ vverbose("UK application_type_code (0x%04x)", UK_APPLICATION_TYPE_CODE);
+ else if(ntohs(desc->application_type_code) == NZ_APPLICATION_TYPE_CODE)
+ vverbose("NZ application_type_code (0x%04x)", NZ_APPLICATION_TYPE_CODE);
+ else
+ vverbose("Unknown application_type_code (0x%04x)", ntohs(desc->application_type_code));
}
else
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-09 16:40:53
|
Revision: 241
http://svn.sourceforge.net/redbutton/?rev=241&view=rev
Author: skilvington
Date: 2007-03-09 08:40:47 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
set initial border for DynamicLineArtClass
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
redbutton-browser/trunk/LineArtClass.c
redbutton-browser/trunk/MHEGCanvas.c
redbutton-browser/trunk/MHEGCanvas.h
redbutton-browser/trunk/TODO
redbutton-browser/trunk/add_instance_vars.conf
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-07 17:11:28 UTC (rev 240)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-09 16:40:47 UTC (rev 241)
@@ -27,6 +27,16 @@
/* offscreen canvas to draw on */
t->inst.canvas = new_MHEGCanvas(t->inst.BoxSize.x_length, t->inst.BoxSize.y_length);
+ /*
+ * default value for BorderedBoundingBox is true
+ * the border uses OriginalLineWidth/Style/Colour
+ * ie it can never change
+ */
+ if(!t->have_bordered_bounding_box || t->bordered_bounding_box)
+ MHEGCanvas_setBorder(t->inst.canvas, t->original_line_width, t->original_line_style, &t->inst.OriginalRefLineColour);
+ /* now we have set the border, clear the drawing area */
+ MHEGCanvas_clear(t->inst.canvas, &t->inst.OriginalRefFillColour);
+
/* add it to the DisplayStack of the active application */
MHEGEngine_addVisibleObject(&t->rootClass);
@@ -197,6 +207,7 @@
/* TODO */
/* clear to OriginalRefFillColour */
+/* dont forget to update the border */
printf("TODO: DynamicLineArtClass_SetBoxSize clear to OriginalRefFillColour\n");
/* if it is active, redraw it */
Modified: redbutton-browser/trunk/LineArtClass.c
===================================================================
--- redbutton-browser/trunk/LineArtClass.c 2007-03-07 17:11:28 UTC (rev 240)
+++ redbutton-browser/trunk/LineArtClass.c 2007-03-09 16:40:47 UTC (rev 241)
@@ -27,15 +27,19 @@
/* default colour is black */
if(t->have_original_ref_line_colour)
- MHEGColour_fromColour(&v->RefLineColour, &t->original_ref_line_colour);
+ MHEGColour_fromColour(&v->OriginalRefLineColour, &t->original_ref_line_colour);
else
- MHEGColour_black(&v->RefLineColour);
+ MHEGColour_black(&v->OriginalRefLineColour);
+ /* initial line colour */
+ memcpy(&v->RefLineColour, &v->OriginalRefLineColour, sizeof(MHEGColour));
/* default is transparent */
if(t->have_original_ref_fill_colour)
- MHEGColour_fromColour(&v->RefFillColour, &t->original_ref_fill_colour);
+ MHEGColour_fromColour(&v->OriginalRefFillColour, &t->original_ref_fill_colour);
else
- MHEGColour_transparent(&v->RefFillColour);
+ MHEGColour_transparent(&v->OriginalRefFillColour);
+ /* initial fill colour */
+ memcpy(&v->RefFillColour, &v->OriginalRefFillColour, sizeof(MHEGColour));
/* derived classes must init this if they want to use it */
v->canvas = NULL;
Modified: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c 2007-03-07 17:11:28 UTC (rev 240)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-09 16:40:47 UTC (rev 241)
@@ -2,6 +2,7 @@
* MHEGCanvas.c
*/
+#include "ISO13522-MHEG-5.h"
#include "MHEGCanvas.h"
#include "utils.h"
@@ -22,3 +23,37 @@
safe_free(c);
}
+/*
+ * set a border, no drawing will be done in the border (apart from the border itself)
+ * width is in pixels
+ * style should be one of:
+ * original_line_style_solid
+ * original_line_style_dashed
+ * original_line_style_dotted
+ */
+
+void
+MHEGCanvas_setBorder(MHEGCanvas *c, int width, int style, MHEGColour *colour)
+{
+ if(width <= 0)
+ return;
+
+/* TODO */
+printf("TODO: MHEGCanvas_setBorder: width=%d style=%d RGBT=%02x%02x%02x%02x\n", width, style, colour->r, colour->g, colour->b, colour->t);
+
+ return;
+}
+
+/*
+ * fill the image (excluding the border) with the given colour
+ */
+
+void
+MHEGCanvas_clear(MHEGCanvas *c, MHEGColour *colour)
+{
+/* TODO */
+printf("TODO: MHEGCanvas_clear: RGBT=%02x%02x%02x%02x\n", colour->r, colour->g, colour->b, colour->t);
+
+ return;
+}
+
Modified: redbutton-browser/trunk/MHEGCanvas.h
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.h 2007-03-07 17:11:28 UTC (rev 240)
+++ redbutton-browser/trunk/MHEGCanvas.h 2007-03-09 16:40:47 UTC (rev 241)
@@ -12,10 +12,15 @@
{
Pixmap contents; /* current image */
Picture contents_pic; /* XRender wrapper */
+ GC gc; /* contains the clip mask for the border */
} MHEGCanvas;
MHEGCanvas *new_MHEGCanvas(unsigned int, unsigned int);
void free_MHEGCanvas(MHEGCanvas *);
+void MHEGCanvas_setBorder(MHEGCanvas *, int, int, MHEGColour *);
+
+void MHEGCanvas_clear(MHEGCanvas *, MHEGColour *);
+
#endif /* __MHEGCANVAS_H__ */
Modified: redbutton-browser/trunk/TODO
===================================================================
--- redbutton-browser/trunk/TODO 2007-03-07 17:11:28 UTC (rev 240)
+++ redbutton-browser/trunk/TODO 2007-03-09 16:40:47 UTC (rev 241)
@@ -1,6 +1,3 @@
-BorderedBoundingBox
-
-
aspect ratio
Modified: redbutton-browser/trunk/add_instance_vars.conf
===================================================================
--- redbutton-browser/trunk/add_instance_vars.conf 2007-03-07 17:11:28 UTC (rev 240)
+++ redbutton-browser/trunk/add_instance_vars.conf 2007-03-09 16:40:47 UTC (rev 241)
@@ -141,6 +141,12 @@
#define LineStyle_dotted original_line_style_dotted
MHEGColour RefLineColour;
MHEGColour RefFillColour;
+ /*
+ * OriginalRefLine/FillColour are optional but have defaults defined in the spec
+ * store them here so we don't have to keep checking if they were specified or not
+ */
+ MHEGColour OriginalRefLineColour;
+ MHEGColour OriginalRefFillColour;
/* only used by DynamicLineArtClass */
MHEGCanvas *canvas;
} LineArtClassInstanceVars;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-07 17:11:39
|
Revision: 240
http://svn.sourceforge.net/redbutton/?rev=240&view=rev
Author: skilvington
Date: 2007-03-07 09:11:28 -0800 (Wed, 07 Mar 2007)
Log Message:
-----------
add MHEGCanvas offscreen drawing class
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
redbutton-browser/trunk/LineArtClass.c
redbutton-browser/trunk/Makefile
redbutton-browser/trunk/add_instance_vars.conf
Added Paths:
-----------
redbutton-browser/trunk/MHEGCanvas.c
redbutton-browser/trunk/MHEGCanvas.h
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-06 17:05:36 UTC (rev 239)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-07 17:11:28 UTC (rev 240)
@@ -24,6 +24,9 @@
default_LineArtClassInstanceVars(t, &t->inst);
+ /* offscreen canvas to draw on */
+ t->inst.canvas = new_MHEGCanvas(t->inst.BoxSize.x_length, t->inst.BoxSize.y_length);
+
/* add it to the DisplayStack of the active application */
MHEGEngine_addVisibleObject(&t->rootClass);
Modified: redbutton-browser/trunk/LineArtClass.c
===================================================================
--- redbutton-browser/trunk/LineArtClass.c 2007-03-06 17:05:36 UTC (rev 239)
+++ redbutton-browser/trunk/LineArtClass.c 2007-03-07 17:11:28 UTC (rev 240)
@@ -37,6 +37,9 @@
else
MHEGColour_transparent(&v->RefFillColour);
+ /* derived classes must init this if they want to use it */
+ v->canvas = NULL;
+
return;
}
@@ -46,6 +49,9 @@
if(v->have_PaletteRef)
free_ObjectReference(&v->PaletteRef);
+ if(v->canvas != NULL)
+ free_MHEGCanvas(v->canvas);
+
return;
}
Added: redbutton-browser/trunk/MHEGCanvas.c
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.c (rev 0)
+++ redbutton-browser/trunk/MHEGCanvas.c 2007-03-07 17:11:28 UTC (rev 240)
@@ -0,0 +1,24 @@
+/*
+ * MHEGCanvas.c
+ */
+
+#include "MHEGCanvas.h"
+#include "utils.h"
+
+MHEGCanvas *
+new_MHEGCanvas(unsigned int width, unsigned int height)
+{
+ MHEGCanvas *c = safe_mallocz(sizeof(MHEGCanvas));
+
+/* TODO */
+printf("TODO: new_MHEGCanvas(%u, %u)\n", width, height);
+
+ return c;
+}
+
+void
+free_MHEGCanvas(MHEGCanvas *c)
+{
+ safe_free(c);
+}
+
Added: redbutton-browser/trunk/MHEGCanvas.h
===================================================================
--- redbutton-browser/trunk/MHEGCanvas.h (rev 0)
+++ redbutton-browser/trunk/MHEGCanvas.h 2007-03-07 17:11:28 UTC (rev 240)
@@ -0,0 +1,21 @@
+/*
+ * MHEGCanvas.h
+ */
+
+#ifndef __MHEGCANVAS_H__
+#define __MHEGCANVAS_H__
+
+#include <X11/Xlib.h>
+#include <X11/extensions/Xrender.h>
+
+typedef struct
+{
+ Pixmap contents; /* current image */
+ Picture contents_pic; /* XRender wrapper */
+} MHEGCanvas;
+
+MHEGCanvas *new_MHEGCanvas(unsigned int, unsigned int);
+void free_MHEGCanvas(MHEGCanvas *);
+
+#endif /* __MHEGCANVAS_H__ */
+
Modified: redbutton-browser/trunk/Makefile
===================================================================
--- redbutton-browser/trunk/Makefile 2007-03-06 17:05:36 UTC (rev 239)
+++ redbutton-browser/trunk/Makefile 2007-03-07 17:11:28 UTC (rev 240)
@@ -65,6 +65,7 @@
OBJS= rb-browser.o \
MHEGEngine.o \
MHEGDisplay.o \
+ MHEGCanvas.o \
MHEGBackend.o \
MHEGApp.o \
MHEGColour.o \
Modified: redbutton-browser/trunk/add_instance_vars.conf
===================================================================
--- redbutton-browser/trunk/add_instance_vars.conf 2007-03-06 17:05:36 UTC (rev 239)
+++ redbutton-browser/trunk/add_instance_vars.conf 2007-03-07 17:11:28 UTC (rev 240)
@@ -124,6 +124,7 @@
<LineArtClass>
#include "MHEGColour.h"
+#include "MHEGCanvas.h"
typedef struct
{
@@ -140,6 +141,8 @@
#define LineStyle_dotted original_line_style_dotted
MHEGColour RefLineColour;
MHEGColour RefFillColour;
+ /* only used by DynamicLineArtClass */
+ MHEGCanvas *canvas;
} LineArtClassInstanceVars;
</LineArtClass>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-03-06 17:05:43
|
Revision: 239
http://svn.sourceforge.net/redbutton/?rev=239&view=rev
Author: skilvington
Date: 2007-03-06 09:05:36 -0800 (Tue, 06 Mar 2007)
Log Message:
-----------
DynamicLineArtClass Set/GetPosition and Set/GetBoxSize
Modified Paths:
--------------
redbutton-browser/trunk/DynamicLineArtClass.c
Modified: redbutton-browser/trunk/DynamicLineArtClass.c
===================================================================
--- redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-06 12:19:18 UTC (rev 238)
+++ redbutton-browser/trunk/DynamicLineArtClass.c 2007-03-06 17:05:36 UTC (rev 239)
@@ -8,6 +8,10 @@
#include "RootClass.h"
#include "ExternalReference.h"
#include "GenericObjectReference.h"
+#include "GenericInteger.h"
+#include "VariableClass.h"
+#include "IntegerVariableClass.h"
+#include "rtti.h"
void
DynamicLineArtClass_Preparation(DynamicLineArtClass *t)
@@ -117,43 +121,124 @@
void
DynamicLineArtClass_SetPosition(DynamicLineArtClass *t, SetPosition *params, OctetString *caller_gid)
{
+ XYPosition old;
+
verbose("DynamicLineArtClass: %s; SetPosition", ExternalReference_name(&t->rootClass.inst.ref));
/* corrigendum says we don't need to clear to OriginalRefFillColour */
-/* TODO */
-printf("TODO: DynamicLineArtClass_SetPosition not yet implemented\n");
+ old.x_position = t->inst.Position.x_position;
+ old.y_position = t->inst.Position.y_position;
+
+ t->inst.Position.x_position = GenericInteger_getInteger(¶ms->new_x_position, caller_gid);
+ t->inst.Position.y_position = GenericInteger_getInteger(¶ms->new_y_position, caller_gid);
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ {
+ MHEGEngine_redrawArea(&old, &t->inst.BoxSize);
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+ }
+
return;
}
void
DynamicLineArtClass_GetPosition(DynamicLineArtClass *t, GetPosition *params, OctetString *caller_gid)
{
+ VariableClass *var;
+
verbose("DynamicLineArtClass: %s; GetPosition", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_GetPosition not yet implemented\n");
+ /* X position */
+ if((var = (VariableClass *) MHEGEngine_findObjectReference(¶ms->x_position_var, caller_gid)) == NULL)
+ return;
+
+ if(var->rootClass.inst.rtti != RTTI_VariableClass
+ || VariableClass_type(var) != OriginalValue_integer)
+ {
+ error("DynamicLineArtClass: GetPosition: type mismatch");
+ return;
+ }
+
+ IntegerVariableClass_setInteger(var, t->inst.Position.x_position);
+
+ /* Y position */
+ if((var = (VariableClass *) MHEGEngine_findObjectReference(¶ms->y_position_var, caller_gid)) == NULL)
+ return;
+
+ if(var->rootClass.inst.rtti != RTTI_VariableClass
+ || VariableClass_type(var) != OriginalValue_integer)
+ {
+ error("DynamicLineArtClass: GetPosition: type mismatch");
+ return;
+ }
+
+ IntegerVariableClass_setInteger(var, t->inst.Position.y_position);
+
return;
}
void
DynamicLineArtClass_SetBoxSize(DynamicLineArtClass *t, SetBoxSize *params, OctetString *caller_gid)
{
+ OriginalBoxSize old;
+
verbose("DynamicLineArtClass: %s; SetBoxSize", ExternalReference_name(&t->rootClass.inst.ref));
+ old.x_length = t->inst.BoxSize.x_length;
+ old.y_length = t->inst.BoxSize.y_length;
+
+ t->inst.BoxSize.x_length = GenericInteger_getInteger(¶ms->x_new_box_size, caller_gid);
+ t->inst.BoxSize.y_length = GenericInteger_getInteger(¶ms->y_new_box_size, caller_gid);
+
/* TODO */
-printf("TODO: DynamicLineArtClass_SetBoxSize not yet implemented\n");
/* clear to OriginalRefFillColour */
+printf("TODO: DynamicLineArtClass_SetBoxSize clear to OriginalRefFillColour\n");
+
+ /* if it is active, redraw it */
+ if(t->rootClass.inst.RunningStatus)
+ {
+ MHEGEngine_redrawArea(&t->inst.Position, &old);
+ MHEGEngine_redrawArea(&t->inst.Position, &t->inst.BoxSize);
+ }
+
return;
}
void
DynamicLineArtClass_GetBoxSize(DynamicLineArtClass *t, GetBoxSize *params, OctetString *caller_gid)
{
+ VariableClass *var;
+
verbose("DynamicLineArtClass: %s; GetBoxSize", ExternalReference_name(&t->rootClass.inst.ref));
-/* TODO */
-printf("TODO: DynamicLineArtClass_GetBoxSize not yet implemented\n");
+ /* width */
+ if((var = (VariableClass *) MHEGEngine_findObjectReference(¶ms->x_box_size_var, caller_gid)) == NULL)
+ return;
+
+ if(var->rootClass.inst.rtti != RTTI_VariableClass
+ || VariableClass_type(var) != OriginalValue_integer)
+ {
+ error("DynamicLineArtClass: GetBoxSize: type mismatch");
+ return;
+ }
+
+ IntegerVariableClass_setInteger(var, t->inst.BoxSize.x_length);
+
+ /* height */
+ if((var = (VariableClass *) MHEGEngine_findObjectReference(¶ms->y_box_size_var, caller_gid)) == NULL)
+ return;
+
+ if(var->rootClass.inst.rtti != RTTI_VariableClass
+ || VariableClass_type(var) != OriginalValue_integer)
+ {
+ error("DynamicLineArtClass: GetBoxSize: type mismatch");
+ return;
+ }
+
+ IntegerVariableClass_setInteger(var, t->inst.BoxSize.y_length);
+
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|